I am using the lubridate package and applying the month function to extract month from date. I ran the str command on date field and I got
Factor w/ 9498 levels "01/01/1979","01/01/1980",..: 5305 1 1 1 1 1 1 1 1 1 ...
> v1$Date<-month(v1$Date)
Error in as.…
I have a data frame with a character column of dates.
When I use as.Date, most of my dates are parsed correctly, except for a few instances. The example below will hopefully show you what is going on.
# my …
Suppose I have the following data.frame foo
start.time duration
1 2012-02-06 15:47:00 1
2 2012-02-06 15:02:00 2
3 2012-02-22 10:08:00 3
4 2012-02-22 09:32:00 4
5 2012-03-21 13:47:00 5
And class(foo$start.time) returns
[1] "POSIXct" "POSIXt"
I'd like to create a plot of foo$duration v. foo$…