Re: [R] Date extract Year

2015-03-13 Thread archsteve
Ha, sorry for the obtuseness Rolf. New to this. Thanks for your help. -Steve > On Mar 8, 2015, at 9:25 PM, Rolf Turner [via R] > wrote: > > Rolf Turner -- View this message in context: http://r.789695.n4.nabble.com/Date-extract-Year-tp4704295p4704614.html Sent from the R help mailing

Re: [R] Date extract Year

2015-03-08 Thread Rolf Turner
On 09/03/15 07:27, Steven Archambault wrote: My date column is the excel numeric date format. For instance, in excel, that first date is 11 September 2012. And we were supposed to know that? The level of obtuseness of people who post to this list truly knows no lower bound. Be that as it ma

Re: [R] Date extract Year

2015-03-08 Thread Bert Gunter
... and that is the source of your difficulties, as I and others have told you. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Sun, Mar 8, 2015 at 11:27 A

Re: [R] Date extract Year

2015-03-08 Thread Steven Archambault
My date column is the excel numeric date format. For instance, in excel, that first date is 11 September 2012. On Mar 8, 2015, at 10:41 AM, Frederic Ntirenganya wrote: > Hi Steve, > > Can you please explain to us your date column? thanks. > > Regards, > Fredo. > On Mar 8, 2015 7:32 PM, "Steve

Re: [R] Date extract Year

2015-03-08 Thread Spencer Graves
The Ecfun package includes a function "as.Date1970", that merely provides a default origin for "as.Date". This kind of thing can be found using library(sos) findFn('as.Date1970') This produced a list in my default browser showing 4 links in 3 packages, the first 2 of whic

Re: [R] Date extract Year

2015-03-08 Thread Bert Gunter
Please read ?as.Date carefully. Your argument appears to be numeric (??) and you do not seem to have specified an origin: "as.Date will accept numeric data (the number of days since an epoch), but only if origin is supplied." Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 46

Re: [R] Date extract Year

2015-03-08 Thread Frederic Ntirenganya
Hi Steve, Can you please explain to us your date column? thanks. Regards, Fredo. On Mar 8, 2015 7:32 PM, "Steve Archambault" wrote: > Hi all, > > I am trying in vain to create a new object "Year" in my data frame from > existing Date data. I have tried many different approaches, but can't seem

Re: [R] Date extract Year

2015-03-08 Thread Steve Archambault
Hi all, I am trying in vain to create a new object "Year" in my data frame from existing Date data. I have tried many different approaches, but can't seem to get it to work. Here is an example of some code I tried. date1<- as.Date(wells$Date,"%m/%d/%Y") wells$year<-as.numeric(format(date1, "%Y"))