Re: [R] Problem with as.POSIXct()

2011-06-01 Thread Stefan Peterson
circe hotmail.com> writes: > > Hi, when I type in these words: > > > a=c("2011-06-01 17:21:24.83", "2011-06-01 17:21:24.283") > > as.POSIXct(a) > > the real output is: >[1] "2011-06-01 17:21:24.830 CST" "2011-06-01 17:21:24.283 CST" > > rather than the expected one: >[1] "2011-06-01 1

[R] Problem with as.POSIXct()

2011-06-01 Thread circe
Hi, when I type in these words: > a=c("2011-06-01 17:21:24.83", "2011-06-01 17:21:24.283") > as.POSIXct(a) the real output is: [1] "2011-06-01 17:21:24.830 CST" "2011-06-01 17:21:24.283 CST" rather than the expected one: [1] "2011-06-01 17:21:24.083 CST" "2011-06-01 17:21:24.283 CST" H

Re: [R] Problem with as.POSIXct on dates object

2009-07-20 Thread Gabor Grothendieck
On Mon, Jul 20, 2009 at 5:16 AM, Denis Chabot wrote: > Hi, > > if you look at my example in recent thread "Rép : [R] problem with > as.POSIXct and daylight savings time", it appears that tz argument is used > by as.POSIX.ct > > Denis Chabot > Le 09-07

Re: [R] Problem with as.POSIXct on dates object

2009-07-20 Thread Denis Chabot
Hi, if you look at my example in recent thread "Rép : [R] problem with as.POSIXct and daylight savings time", it appears that tz argument is used by as.POSIX.ct Denis Chabot Le 09-07-20 à 00:00, Remko Duursma a écrit : as.POSIXct.dates does not make use of tz: Ok, but it is s

Re: [R] Problem with as.POSIXct on dates object

2009-07-19 Thread Remko Duursma
> as.POSIXct.dates does not make use of tz: Ok, but it is supposed to, right? Or maybe the documentation can be updated, because ?as.POSIXct does seem to imply the timezone is used (as it is for other methods of as.POSIXct). thanks, Remko - Remk

Re: [R] Problem with as.POSIXct on dates object

2009-07-19 Thread Gabor Grothendieck
as.POSIXct.dates does not make use of tz: > as.POSIXct.dates function (x, ...) { if (inherits(x, "dates")) { z <- attr(x, "origin") x <- as.numeric(x) * 86400 if (length(z) == 3L && is.numeric(z)) x <- x + as.numeric(ISOdate(z[3L], z[1L], z[2L],

[R] Problem with as.POSIXct on dates object

2009-07-19 Thread Remko Duursma
Dear R-helpers, I have a problem converting an object made with the 'chron' function to a POSIXct object: # Make date based on DOY dat <- chron(dates=232, origin.=c(month=1, day=1, year=2008)) dat #[1] 08/20/08 # Converting to POSIXct uses current timezone (Sydney): as.POSIXct(dat) #[1] "2008-

Re: [R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread Gabor Grothendieck
as.chron.POSIXt has an offset= argument and it may be a vector: > args(chron:::as.chron.POSIXt) function (x, offset = 0, tz = "GMT", ...) On Sun, Jul 19, 2009 at 9:10 AM, Denis Chabot wrote: > [was "  [R] end of daylight saving time"] > > Hi, > > I got no reply with the previous subject line, pro

Re: [R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread Denis Chabot
Thanks for the suggestion, Spencer. I will take a look and will report to the list if I find this a better solution for my situation. Might take a couple of days though. Denis Le 09-07-19 à 12:42, spencerg a écrit : Have you considered the "timeDate" package? Spencer Denis Chabot wrote

Re: [R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread spencerg
Have you considered the "timeDate" package? Spencer Denis Chabot wrote: Thank you very much Duncan. I'll follow your suggestion. Why do I want to do what the designer did not think anyone would want to do? I have data acquisition equipment taking measurements every 15 min or so for d

Re: [R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread Denis Chabot
Thank you very much Duncan. I'll follow your suggestion. Why do I want to do what the designer did not think anyone would want to do? I have data acquisition equipment taking measurements every 15 min or so for days at a time, and I need to compile all such experiments in a master data set

Re: [R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread Duncan Murdoch
On 19/07/2009 11:23 AM, Denis Chabot wrote: [was " [R] end of daylight saving time"] Hi, I got no reply with the previous subject line, probably a bad choice of subject on my part, so here it is again. I read from the help on DateTimeClasses and various posts on this list that, quite

[R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread Denis Chabot
[was " [R] end of daylight saving time"] Hi, I got no reply with the previous subject line, probably a bad choice of subject on my part, so here it is again. I read from the help on DateTimeClasses and various posts on this list that, quite logically, one needs to specify if DST is act

[R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread Denis Chabot
[was " [R] end of daylight saving time"] Hi, I got no reply with the previous subject line, probably a bad choice of subject on my part, so here it is again. I read from the help on DateTimeClasses and various posts on this list that, quite logically, one needs to specify if DST is active o