Re: [R] interpreting date-related error message

2010-08-27 Thread Toby Gass
Thanks to everyone for the explanations. Toby On 27 Aug 2010 at 12:46, Phil Spector wrote: > Toby - > Since dat$doy is just a number, the default S3 method > for format is used, where the second argument is the trim > parameter. I suspect you are confusing format (which is for > output) wi

Re: [R] interpreting date-related error message

2010-08-27 Thread Phil Spector
Toby - Since dat$doy is just a number, the default S3 method for format is used, where the second argument is the trim parameter. I suspect you are confusing format (which is for output) with strptime (which is for input). For example, strptime(dat$doy,'%j') will assume that the dates

Re: [R] interpreting date-related error message

2010-08-27 Thread David Winsemius
On Aug 27, 2010, at 3:29 PM, Toby Gass wrote: Hello, helpeRs, I have a vector of numbers from 1-365 (days of the year) that I would like to convert to a date. There are no NA's and no missing values. I did not insert leading zero's for numbers less than 100. Using the syntax: dat$doy.1 <- a

Re: [R] interpreting date-related error message

2010-08-27 Thread Erik Iverson
Toby, What is it that you're trying to accomplish? There seems to be several ideas confused in your post. It sounds like you have input x <- 1:365 and you want to call some function to return dates? Which date should be returned for input 1? January 1, 2010? Your error is because if you giv

[R] interpreting date-related error message

2010-08-27 Thread Toby Gass
Hello, helpeRs, I have a vector of numbers from 1-365 (days of the year) that I would like to convert to a date. There are no NA's and no missing values. I did not insert leading zero's for numbers less than 100. Using the syntax: dat$doy.1 <- as.numeric(format(dat$doy, "%j" )) I get the fol