Hi Ogbos, Try this: oodates<-read.table(text="1963 335 0 1963 335 1 1963 335 2 1963 335 3 1963 335 4 1963 335 5 1963 335 6 1963 335 7 1963 335 8 1963 335 9 1996 202 20 1996 202 21 1996 202 22 1996 202 23 1996 203 0 1996 203 1 1996 203 2 1996 203 3 2018 365 20 2018 365 21 2018 365 22 2018 365 23") oodates$Pdate<-strptime(paste(oodates[,1],oodates[,2],oodates[,3]), format="%Y %j %H")
Jim On Thu, Jan 23, 2020 at 8:24 PM Ogbos Okike <giftedlife2...@gmail.com> wrote: > > Dear Experts, > I have a data spanning 56 years from 1963 to 2018. > The datetime format is in DOY hour: > 1963 335 0 > 1963 335 1 > 1963 335 2 > 1963 335 3 > 1963 335 4 > 1963 335 5 > 1963 335 6 > 1963 335 7 > 1963 335 8 > 1963 335 9 > 1996 202 20 > 1996 202 21 > 1996 202 22 > 1996 202 23 > 1996 203 0 > 1996 203 1 > 1996 203 2 > 1996 203 3 > 2018 365 20 > 2018 365 21 > 2018 365 22 > 2018 365 23 > When I used: > as.Date(335,origin="1963-01-01"), for the first row, I got: > [1] "1963-12-02" > This is the format I want, though it is not yet complete. Time is missing. > > Again, I can't be doing this one after the other. I guess you have a > better way of handling this. I have spent some time trying to get it > right but I am really stuck. I would be most glad if you could spare > your busy time to help me again. > > Thank you very much for your usual kind assistance. > > Best regards > Ogbos > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.