Re: [R] Problem with strptime

2012-05-28 Thread Des Callaghan
Fantastic, thanks very much Richard. The addition of 'tz="GMT"' worked a treat. Best wishes, Des From: Richard M. Heiberger [mailto:r...@temple.edu] Sent: 28 May 2012 02:09 To: Des Callaghan Cc: r-help@r-project.org Subject: Re: [R] Problem with strptime Some of your

Re: [R] Problem with strptime

2012-05-27 Thread Richard M. Heiberger
Some of your dates are displayed BST and some GMT. High probablilty your dates span the break between summer time and regular time when certain hours do not exist. (in the US we go from 0200 directly to 0301 in the spring when we move from standard time to daylight time). 0230 would therefore be

Re: [R] Problem with strptime

2012-05-27 Thread R. Michael Weylandt
Dates and times are notoriously tricky to get right and the fact that the printed representation is so different from the internal (which is basically just a count of seconds) doesn't really help: to make this fully reproducible, could you supply us with the output of dput(head(read.table("data1.t

[R] Problem with strptime

2012-05-27 Thread Des Callaghan
Hello Forum, I have a problem with the strptime function. With the 'data1' dataset below it works fine, but with the 'data2' dataset something goes wrong (see final line below). Both data1 and data2 are in exactly the same original format, the only difference is that they span different dates.

Re: [R] Problem with strptime generating missing values where none appear to exist

2010-02-23 Thread Don MacQueen
What happens if you do all that NA checking on dob *before* subtracting 100 from dob$year? What happens if you use difftime() before subtracting the 100? Do you get any NAs if you convert dob to POSIXct? (these are just investigative ideas, obviously) -Don At 6:26 PM + 2/23/10, Jonathan

[R] Problem with strptime generating missing values where none appear to exist

2010-02-23 Thread Jonathan Williams
Dear R Helpers, I am having difficulty with strptime. I wish to find the differences between two vectors of times. I have apparently no difficulty to convert the vectors to the appropriate format using strptime. But, then difftime does not calculate all the differences. Here is the code and outpu

Re: [R] problem with strptime and 2010 dates

2010-01-06 Thread Prof Brian Ripley
On Wed, 6 Jan 2010, Larry White wrote: Hi, I'm reading data from a text file and transforming it in R and my date column seems to be getting corrupted. Can someone point out what's wrong? This code worked fine until I added a new date in 2010. Seems unlikely, but we don't have a reproducible e

Re: [R] problem with strptime and 2010 dates

2010-01-06 Thread jim holtman
Use %Y (upper case) for 4 digit years On Wed, Jan 6, 2010 at 10:25 AM, Larry White wrote: > Hi, I'm reading data from a text file and transforming it in R and my date > column seems to be getting corrupted. Can someone point out what's wrong? > This code worked fine until I added a new date in 2

[R] problem with strptime and 2010 dates

2010-01-06 Thread Larry White
Hi, I'm reading data from a text file and transforming it in R and my date column seems to be getting corrupted. Can someone point out what's wrong? This code worked fine until I added a new date in 2010. thank you. To load the data I run: work_table = read.table(datafilename,header=TRUE)

Re: [R] Problem with strptime

2008-10-03 Thread jim holtman
Your example works fine for me: > x <- read.table(textConnection("13199 2008-03-19 03:55:46 + 13200 2008-03-19 04:00:46 + 13201 2008-03-19 04:05:46 + 13202 2008-03-19 04:10:46 + 13203 2008-03-19 04:15:46"), as.is=TRUE) > closeAllConnections() > x$time <- as.POSIXct(strptime(paste(x$V2, x$V3), "%Y-

[R] Problem with strptime

2008-10-03 Thread Solene Goy
Hello, I have a column with dates in the form %Y-%m-%d %H:%M:%S; I want to substract the line i+1 to the line i and get a numeric result (in seconds for instance). This is what I did (I take the data from a database): res<- dbSendQuery (con, "SELECT Date_Heure FROM data.meteo ")Time<-fetch(re

Re: [R] Problem with strptime

2008-01-12 Thread Dirk Eddelbuettel
On 12 January 2008 at 16:18, Sandrine-et-Francois wrote: | Dear R-list, | I'm experiencing some problems while using "strptime", which I don't understand. | | > str(natver) | 'data.frame': 154 obs. of 8 variables: | $ ID : Factor w/ 14 levels "AC","ALS","FA",..: 10 11 9 1 4 8 13 3 14 12

[R] Problem with strptime

2008-01-12 Thread Sandrine-et-Francois
Dear R-list, I'm experiencing some problems while using "strptime", which I don't understand. > str(natver) 'data.frame': 154 obs. of 8 variables: $ ID : Factor w/ 14 levels "AC","ALS","FA",..: 10 11 9 1 4 8 13 3 14 12 ... $ CdBMin : int 22 22 26 26 28 23 27 23 25 26 ... $ CdBMax :