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
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
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
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
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
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
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-
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
8 matches
Mail list logo