Don asks a good question. Here is the analogy from the grid package.
> library(grid)
> unit(12, "in")
[1] 12in
> unit(12, "cm")
[1] 12cm
> unit.c(unit(12, "in"), unit(12, "cm"))
[1] 12in 12cm
> c(unit(12, "in"), unit(12, "cm"))
[1] 12 12
> ?unit
> convertUnit(c(unit(12, "in"), unit(12, "cm")), "i
I think a more illuminating inspection is this:
> attributes(A)
$class
[1] "POSIXct" "POSIXt"
$tzone
[1] "UTC"
> attributes(B)
$class
[1] "POSIXct" "POSIXt"
$tzone
[1] "UTC"
> attributes(C)
$class
[1] "POSIXct" "POSIXt"
Note that the operation c(A,B) loses the $tzone attribute.
Note also
I believe the lubridate package does a good job with time zones.
> install.packages("lubridate")
> library(lubridate)
Look at the supplied functions with_tz() and force_tz().
HTH,
Bill.
William J. Michels, Ph.D.
On Fri, Apr 7, 2017 at 12:52 AM, Jeff Newmiller
wrote:
> R does a poor job
R does a poor job of supporting timezone-specific objects... you have to
transfer the necessary attributes explicitly for many operations. (It does no
job of supporting element-specific timezones so don't go there.)
The good news is that R is pretty good at working with points in time, since
t
Thanks a lot - good idea:
I put
Sys.setenv(TZ = "UTC")
ahead of the code - solves the problem!
Thanks a lot
Den 07-04-2017 kl. 09:26 skrev Mark Leeds:
> Hi Troels: This is off-list so as to not clog the list with my noise
> because my suggestion may not work. I really don't know that much
>
Thanks a lot - perhaps it is just understanding how times dates are
handled, sorry to bother if that is just the case
C[1]==A[1] # TRUE
but
C[1]
[1] "2013-03-28 07:00:00 CET"
A[1]
[1] "2013-03-28 06:00:00 UTC"
Den 07-04-2017 kl. 08:27 skrev Ulrik Stervbo:
Hi Troels,
I get no error. I
Hi Troels,
I get no error. I think we need more information to be of any help.
Best wishes,
Ulrik
On Fri, 7 Apr 2017 at 08:17 Troels Ring wrote:
> Dear friends - I have further problems handling dates_times, as
> demonstrated below where concatenating two formatted vectors of
> date_times res
Dear friends - I have further problems handling dates_times, as
demonstrated below where concatenating two formatted vectors of
date_times results in errors.
I wonder why this happens and what was wrong in trying to take these two
vectors together
All best wishes
Troels Ring
Aalborg, Denmark
W
8 matches
Mail list logo