Skip to content
Prev 360209 / 398503 Next

as.Date

Dear ALL,
Thank you so much for your contributions.
I have made some progress. Below is a simple script I gleaned from
your kind responses:
Sys.setenv(TZ="Etc/GMT")
dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/92")
     times <- c("23:0:0", "22:0:0", "01:00:00", "18:0:0", "16:0:0")
     x <- paste(dates, times)
     aa<-strptime(x, "%m/%d/%y %H:%M:%S")
bb<-1:5
plot(aa, bb)

I tried plotting my result and I got what I am looking for. I think I
am almost there.

I am, however, stuck here. My data is a large file and the form
differs a little from the example I used. The quotation marks in both
date and time is my headache now. Such inverted commas are not in my
data. I can with awk transform my data to get exactly something like
dd/mm/yy. But I wont know how to make the data appear in quotation
mark in R. I will once more be glad for any more help.
Ogbos

PS: I am still afraid of this forum. Please direct me to the right
forum if this is not ok. Thanks again.
On 4/18/16, peter dalgaard <pdalgd at gmail.com> wrote: