similar to: round.POSIXt gets certain values wrong

Displaying 20 results from an estimated 8000 matches similar to: "round.POSIXt gets certain values wrong"

2002 May 12
0
{round,trunc}.POSIXt and daylight savings time (PR#1543)
I have found what looks like a small problem in trunc.POSIXt() involving the transition to/from standard time and daylight savings time. Assuming my assessment is correct, I have a potential solution to offer. If a time in daylight savings time is rounded such that the rounded value is on the other side of the transition, the isdst element does not get changed accordingly. I have tested only
2002 May 03
1
Daylight savings time and conversion to POSIXt (arghh!)
I have asked this question before, and received some suggestions for work-arounds that get the job done--and they are much appreciated. But I would still like to find out if I'm missing something, and whether there is a direct way using POSIXt functions (as.POSIXct, as.POSIXlt, strptime, in particular). I have environmental data collected once per minute. Here is a subset of 3 input
2003 Jun 17
0
A 'pretty' function for POSIXt objects
I have written a set of functions for POSIXt objects that I would like to offer for consideration for use in base R. They augment and extend existing functions. Briefly, ## pretty.ct function(x,specs=pretty.ct.specs) ## round.ct function(x, tstr='1 min' ) ## axis.ct function(side,x,specs=NULL,...) ## parse.timeint function(dv) ## parse.tstr
2002 Mar 26
1
seq.POSIXt() with short time intervals
I was surprised when seq.POSIXt() returned a single value rather than a vector, from inputs that I thought were reasonable. Here's an example to illustrate: > t0 <- ISOdatetime(2002,6,24,0,0,10) ## expected a sequence of 16 times 1 second apart > seq.POSIXt(from=t0,to=t0+15,by='1 sec') [1] "2002-06-24 00:00:10 PDT" ## traces to this call >
2011 Mar 23
0
suggestions re trunc.POSIXt
Dear all, I hope this is a right place to post this; r-help might be appropriate but it looks like I'm suggesting a change in base package, so I decided to post here. (+ Apologies if that has been changed recently -- the version I'm using is R.2.12.2 on Windows.) I've noticed an unexpected behavior of trunc.POSIXt: foo <- seq(as.POSIXct( "2009-10-23 22:00:00"),
2011 Feb 19
1
problem in plotting numeric x by POSIXt class with lattice
# hi all, # I'm trying to plot temperatures by date in a trellis plot by their stations # I'm plotting the following data.frame library(lattice) h <- structure(list(station_name = structure(c(3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L, 5L, 8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L, 5L, 8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L), .Label = c("Ashqelon", "Beer Sheva",
2002 May 01
1
julian() in base depends on chron
It appears that julian() is in R-base, but julian.default() is in the chron package. > search() [1] ".GlobalEnv" "package:ctest" "Autoloads" "package:base" > julian(1:3,4:6,1991:1993) Error in julian(1:3, 4:6, 1991:1993) : no applicable method for "julian" > find('julian') [1] "package:base" >
2007 Dec 11
3
Wrong length of POSIXt vectors (PR#10507)
Full_Name: Petr Simecek Version: 2.5.1, 2.6.1 OS: Windows XP Submission from: (NULL) (195.113.231.2) Several times I have experienced that a length of a POSIXt vector has not been computed right. Example: tv<-structure(list(sec = c(50, 0, 55, 12, 2, 0, 37, NA, 17, 3, 31 ), min = c(1L, 10L, 11L, 15L, 16L, 18L, 18L, NA, 20L, 22L, 22L ), hour = c(12L, 12L, 12L, 12L, 12L, 12L, 12L, NA, 12L,
2009 Mar 04
2
patch for axis.POSIXct (related to timezones)
I am finding that axis.POSIXct uses the local timezone for deciding where to put tic marks, even if the data being plotted are in another time zone. The solution is to use attr() to copy from the 'x' (provided as an argument) to the 'z' (used for the 'at' locations). I have pasted my proposed solution in section 1 below (as a diff). Then, in section 2, I'll put some
2001 Sep 27
1
Problem with merge() (PR#1102)
I have encountered a problem with merge() that appears to be a bug. Here's an example to illustrate it. > tmp1 <- data.frame(a=letters[1:3],b=LETTERS[2:4],x=1:3) > tmpa <- expand.grid(a=letters[1:4],b=LETTERS[1:4]) > tmpm.1 <- merge(tmpa,tmp1) > tmpm.2 <- merge(tmp1,tmpa) Error in "names<-.default"(*tmp*, value = vnames) : names attribute must
2002 Apr 26
1
Problem with read.xport() from foreign package
I have found that data imported from SAS using read.xport() in package foreign (installed recently) does not match the original data, when the data consists of character strings that are only one character long. Here is an example. ---- SAS commands to create the data ---- options nocenter; data foo; a='a'; b='bb'; length c d $2; c='c'; d='
2020 Oct 02
0
timezone tests and R-devel
Thank you for the report. In R-devel, all.equal.POSIXt() by default reports inconsistent time zones. Previously, > x <- Sys.time() > all.equal(x, as.POSIXlt(x, tz = "EST5EDT")) would return TRUE. To ignore the time zone attributes in R-devel, the argument 'check.tzone = FALSE' needs to be used. That said, I can reproduce the 'make check' failure in R-devel on
2016 Jan 27
0
Suggestions for improvement as regards `as` methods, and a call for consistency in `as.Date` methods
Good evening all, This topic is gone into at a bit more length at my related Stack Overflow question here: http://stackoverflow.com/questions/34647674/why-do-as-methods-remove-vector-names-and-is-there-a-way-around-it There are two lingering issues despite the abundant insight received at SO, namely: 1) _Why_ do as methods remove their arguments' names attribute? This is a fact which is
2020 Oct 23
1
timezone tests and R-devel
Yes, you are absolutely right and I'm pretty sure this will be fixed in one way or another. IMO, the failing test should simply use all.equal.POSIXt's new argument check.tzone=FALSE. Two simple alternatives modifying all.equal.POSIXt behaviour: - make check.tzone=FALSE the default: this is inconsistent with other arguments of all.equal methods, always defaulting to stricter checks -
2020 Oct 23
0
timezone tests and R-devel
So let me try to raise this issue once more, and perhaps be more clear about what I think the issue is.. In my opinion there is now a bug in make check in R-development (tested today with r79361). As I see it, I specify a reasonable TZ environment variable and this leads to make check emitting an error. Best, Kasper On Fri, Oct 2, 2020 at 11:28 AM Kasper Daniel Hansen < kasperdanielhansen
2002 Apr 08
1
Problem(?) in strptime() -- short version
I decided my earlier email on this topic was rather long and wordy; here's a condensed version. I am sitting at a Solaris computer in the US/Pacific timezone. I have a file of data having times that includes the following three values 2002-4-7 1:30:00 GMT 2002-4-7 2:30:00 GMT 2002-4-7 3:30:00 GMT I have not been able to find a way to correctly convert these to either of the POSIX
2004 May 24
1
as.matrix.data.frame() in R 1.9.0 converts to character when it should (?) convert to numeric
Conversion of a data frame to a matrix using as.matrix() when a column of the data frame is POSIXt and all other columns are numeric has changed in R 1.9.0 from R 1.8.1. The new behavior issues a warning message and converts to a character matrix. In R 1.8.1, such an object was converted to a numeric matrix. Here is an example. #### R 1.9.0 #### > foo <- data.frame(
2010 Feb 01
1
Error with cut.POSIXt and daylight savings time switchover dates
The following code: cut(as.POSIXct("2009-11-01 04:00:00", tz="America/Los_Angeles"), "1 day") gives the error: Error in seq.int(0, to - from, by) : 'to' must be finite This is related to November 1st, 2009 being the switchover date from daylight savings time to standard time in the America/Los_Angeles time zone. In particular, in cut.POSIXt, the starting
2009 Feb 17
0
Problem with +(POSIXt, difftime) dispatching -- WAS: How to create sequence of constant time interval
There seems to be a problem in the way `+` is dispatched for POSIXt/difftime (R 2.8.0 Windows). With the following definitions: t0 <- as.POSIXct('2009-01-01 00:00') halfhour.mins <- as.difftime(30,units='mins') I would have thought that the straightforward answer to Suresh's question would be something like t0 + halfhour.mins * (0:47) And indeed, if we
2020 Oct 01
3
timezone tests and R-devel
The return value of Sys.time() today with a timezone of US/Eastern is unchanged between 4.0.3-patched and devel, but on devel the following test fails all.equal(x, as.POSIXlt(x)) with x = Sys.time() This means that devel does not complete make tests (failure on tests/reg-tests-2.R) It is entirely possible that it is an error on my end, I use export TZ="US/Eastern" but I have been