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

2014-10-01 Thread PIKAL Petr
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 the conversion to factors. Then try to convert date and time

[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

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

2014-09-30 Thread David L Carlson
-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 forum

[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

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 yhj...@googlemail.com 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.

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

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 yhj...@googlemail.com 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

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 yhj...@googlemail.com 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

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