Hi all,
I'm getting confused by date handling.
I wish to read a date from a file wich is a number of seconds since 1970
(POSIXct).
Then i wish to convert this date to a human readable form (POSIXlt)
By example :
ctDate-1132963200 #Wed Aug 30 14:24:37 2006
is(ctDate)
[1] numeric
If I take the following simple data:
YEAR MONTH DAY WEIGHT.KG
2003 10 6 1.2
2003 10 12 1.2
2003 10 16 1.3
and format the date data and plot it:
dates - strptime(paste(DAY,MONTH,YEAR),%d%m%Y)
plot(c(min(dates),max(dates)),c(0,max(WEIGHT.KG)),
xlab=Date,ylab=Weight (kg),type=n)
I am not seeing this on Linux. The x axis marks are at midnight GMT,
hence 1am BST on my system.
On Fri, 17 Oct 2003, Jacob Etches wrote:
If I take the following simple data:
YEAR MONTH DAY WEIGHT.KG
2003 10 6 1.2
2003 10 12 1.2
2003 10 16 1.3
and format the date data and plot it:
The problem is related to time zones. The easiest way to
handle this is to avoid using POSIXt and use chron instead
so you don't have to worry about them.
require(chron)
day - 6:16
dts - dates(paste(10, day, 03, sep=/))
plot(dts,day)
abline(v=dts)
---
From: Jacob Etches [EMAIL PROTECTED]
On Fri, Oct 17, 2003 at 01:16:00PM -0400, Gabor Grothendieck wrote:
The problem is related to time zones. The easiest way to
handle this is to avoid using POSIXt and use chron instead
so you don't have to worry about them.
require(chron)
day - 6:16
dts - dates(paste(10, day, 03,
From: Dirk Eddelbuettel [EMAIL PROTECTED]
On Fri, Oct 17, 2003 at 01:16:00PM -0400, Gabor Grothendieck wrote:
The problem is related to time zones. The easiest way to
handle this is to avoid using POSIXt and use chron instead
so you don't have to worry about them.
I do see the described behavior, on three systems, linux R 1.8.0, Mac
OS X R 1.8.0, and Solaris R 1.7.1.
Plot 1 is different than plot 2; in plot 1 the points are offset to
the left of the axis tick marks.
datet - as.POSIXct(dates)
## 1
plot(datet,WEIGHT.KG)
## 2
plot(datet,WEIGHT.KG,xaxt='n')
So someone forgot to specify the timezone, if the current one was not
wanted.
However, I don't see how timezones can account for a 24hour difference
as originally reported.
On Fri, 17 Oct 2003, Don MacQueen wrote:
I do see the described behavior, on three systems, linux R 1.8.0, Mac
OS X R
At Friday 02:20 PM 10/17/2003 -0400, Gabor Grothendieck wrote:
[material deleted]
Time zones are not part of the problem yet POSIXt forces this
extraneous complication on you. chron has no time zones in the
first place and therefore allows you to work in the natural frame
of the problem, avoiding
From: Tony Plate [EMAIL PROTECTED]
I also see the usefulness of a time-zone-free time/date class,
but why does chron need to be moved to the base to be useful here?
Because other software makes use of times in the base. Package
writers figure that what is in the base is the most available
PROTECTED]
Cc: Jacob Etches [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [R] datetime data and plotting
So someone forgot to specify the timezone, if the current one was not
wanted.
However, I don't see how timezones can account for a 24hour difference
as originally reported.
On Fri, 17
11 matches
Mail list logo