Re: [R] Convert to date and time of the year

2013-03-18 Thread David Winsemius
On Mar 18, 2013, at 8:05 PM, Ben Tupper wrote: > Hi Janesh, > > On Mar 18, 2013, at 10:49 PM, Janesh Devkota wrote: > >> Dear R Users, >> >> I have data for more than 3 years. For each year I want to find the day >> corresponding to Jaunary 1 of that year. For example: >> >>> x <- c('5/5/200

Re: [R] Convert to date and time of the year

2013-03-18 Thread Ben Tupper
Hi Janesh, On Mar 18, 2013, at 10:49 PM, Janesh Devkota wrote: > Dear R Users, > > I have data for more than 3 years. For each year I want to find the day > corresponding to Jaunary 1 of that year. For example: > >> x <- c('5/5/2007','12/31/2007','1/2/2008') > >> #Convert to day of year (juli

[R] Convert to date and time of the year

2013-03-18 Thread Janesh Devkota
Dear R Users, I have data for more than 3 years. For each year I want to find the day corresponding to Jaunary 1 of that year. For example: > x <- c('5/5/2007','12/31/2007','1/2/2008') > #Convert to day of year (julian date) - > strptime(x,"%m/%d/%Y")$yday+1 [1] 125 365 2 I want to know ho