Re: [R] basic help with as.Date()

2015-03-26 Thread Jeff Newmiller
That would be because they are not dates... they don't specify the day. Either add a day of month to the character data before you convert it, or use the yearmon class from zoo. Something like... as.Date(paste("1",as.character(df$mydate),sep="-"), format='%d-%b-%y') And why in the world are yo

Re: [R] basic help with as.Date()

2015-03-26 Thread Marc Schwartz
> On Mar 26, 2015, at 4:11 PM, Simon Kiss wrote: > > Hi there: normally I’m quite comfortable with as.Date(). But this data set is > causing problems. > > The core of the data frame looks like the sample data frame below, but my > attempt to convert df$mydate to a date object returns only NA.

Re: [R] basic help with as.Date()

2015-03-26 Thread Prof Brian Ripley
On 26/03/2015 21:11, Simon Kiss wrote: Hi there: normally I’m quite comfortable with as.Date(). But this data set is causing problems. The core of the data frame looks like the sample data frame below, but my attempt to convert df$mydate to a date object returns only NA. Can anyone provide a