Re: [R] Converting factor data into Date-time format

2014-09-30 Thread PIKAL Petr
gt; project.org] On Behalf Of David L Carlson > Sent: Tuesday, September 30, 2014 10:43 PM > To: tandi perkins; r-help@r-project.org > Subject: Re: [R] Converting factor data into Date-time format > > First, use stringsAsFactors=FALSE with the read.csv() function. That > will prevent

Re: [R] Converting factor data into Date-time format

2014-09-30 Thread David L Carlson
7840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of tandi perkins Sent: Tuesday, September 30, 2014 12:55 PM To: r-help@r-project.org Subject: [R] Converting factor data into Date-time format Hello R help: I am new to this f

[R] Converting factor data into Date-time format

2014-09-30 Thread tandi perkins
Hello R help: I am new to this forum so I apologize in advance for any protocol missteps. I have a data set that is comprised of eight birds with GPS; each of which transmit everyday at 8:00 am, 4:00 pm, and midnight for 1 year (although I have some missing relocation's). I am trying to forma

Re: [R] Converting factor data into Date-time format

2012-03-13 Thread R. Michael Weylandt
No problem. A pro-tip for future posts: the dput() function creates a plain text representation of the data in question which is great for email and is nicely copy-and-pasteable. It wasn't so much a thing here, but for large or complicated data sets, the regular console printout doesn't always rev

Re: [R] Converting factor data into Date-time format

2012-03-13 Thread R. Michael Weylandt
Just a little typo: see below. On Tue, Mar 13, 2012 at 1:00 PM, Haojie Yan wrote: > Dear Michael, > > Thanks a lot for your hints. > > I have just had a try as below but still got back some error messages as > shown: > > The object containing the 'date_time' data is named 'INTERVAL_END_TIME' and

Re: [R] Converting factor data into Date-time format

2012-03-13 Thread Gabor Grothendieck
On Tue, Mar 13, 2012 at 12:20 PM, Haojie Yan wrote: > Dear R-user, > > I have read a dataset from .csv file into R. This dataset includes one > column containing some data in 'date and time' format, e.g. 'dd/mm/ > hh:mm'. > > These data were automatically read and saved as 'factor' in R. When

Re: [R] Converting factor data into Date-time format

2012-03-13 Thread Joshua Wiley
This is just a little comment to supplement Michael's excellent solution. If there are even a few (e.g., 5 each) repeated values, this: as.POSIXct(as.character(levels(x)), format = "%d/%m/%Y %H:%M")[x] will be substantially faster, with the speed gains strongly associated with the number of repl

Re: [R] Converting factor data into Date-time format

2012-03-13 Thread R. Michael Weylandt
as.POSIXct(as.character(FACTORHERE), format = "%d/%m/%Y %H:%M") Michael On Tue, Mar 13, 2012 at 12:20 PM, Haojie Yan wrote: > Dear R-user, > > I have read a dataset from .csv file into R. This dataset includes one > column containing some data in 'date and time' format, e.g. 'dd/mm/ > hh:mm'

[R] Converting factor data into Date-time format

2012-03-13 Thread Haojie Yan
Dear R-user, I have read a dataset from .csv file into R. This dataset includes one column containing some data in 'date and time' format, e.g. 'dd/mm/ hh:mm'. These data were automatically read and saved as 'factor' in R. When I was trying to produce some plots (such as time series) with the