Displaying 20 results from an estimated 10000 matches similar to: "seq.POSIXt() with short time intervals"
2002 Mar 26
0
seq.default test for relative range (PR#1416)
seq.default() tests for the relative range of the from and to
arguments (see excerpt below) and returns from (only) when the
relative range is small. The problem is that "small" is too large.
Also undocumented.
At 17:25 +0000 3/26/02, ripley@stats.ox.ac.uk wrote:
>On Tue, 26 Mar 2002, Don MacQueen wrote:
>
>> I was surprised when seq.POSIXt() returned a single value
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
2007 Dec 14
3
How to convert Datetime numbers from Excel to POSIXt objects
Hi all,
I need to compare time series data files of different time formats. I
had no problems with text format using strptime.
But how can I convert datetime numbers from Excel (days since 30.12.1899
00:00:00) into POSIXt objects?
For example 29770.375 should be converted to "03.07.1981 09:00:00"
I tried the following code and encountered strange results:
t1-t0 gives 29770.33
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 17
0
round.POSIXt gets certain values wrong
For certain values, round.POSIXt(tm,'day') does not round to midnight
as documented. The reason is that trunc.POSIXt() does not adjust the
value of the isdst element. Assuming my assessment of the reason is
correct, I have a potential solution to offer. Additional discussion
is in bug report #1543.
-Don
> x <- c(as.POSIXct('2001-4-1 3:15'),as.POSIXct('2001-5-2
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
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
2002 May 31
2
error in seq.POSIXt?
I am trying to extract only the winters (defined to be 01-Dec through
28-Feb) of daily data from 1948-2002. There are 90 days in each winter
season. I wrote the following code to gather the winter dates into a
single vector:
DJF <- NULL
for(year in 1949:1999) {
temp.begin <- strptime(paste("01/12", year-1, sep="/"), "%d/%m/%Y")
temp.end <-
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
2002 Apr 08
1
Problem(?) in strptime()
I think the following examples illustrate the crux of the matter
(version and OS info are below).
The problem has to do with the transition from standard time to
daylight savings time. My timezone, US/Pacific, has two parts:
standard time (PST) 8 hours behind GMT and daylight savings time
(PDT) 7 hours behind GMT. The transition takes place this year on 7
April at 02:00, when 02:00 is
2004 Mar 30
1
seq.POSIXt() bug not fixed in R 1.8.1 (PR#4558)
I am still experiencing problems with seq.POSIXt() missing off the last day
of the series:
> seq(as.POSIXct("2004-03-25"),as.POSIXct("2004-03-31"),by="DSTdays")
[1] "2004-03-25 GMT Standard Time" "2004-03-26 GMT Standard Time"
"2004-03-27 GMT Standard Time"
[4] "2004-03-28 GMT Standard Time" "2004-03-29 GMT Daylight
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
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
2002 Apr 04
1
html documentation bug in: help(par), 'las'
Currently (R-1.4.1 as well as R-devel, according to
http://stat.ethz.ch/R-alpha/R-devel/library/base/html/par.html), the html
version of help(par) shows
[...]
lab
A numerical vector of the form c(x, y, len) which modifies the way that
axes are annotated. The values of x and y give the (approximate) number
of tickmarks on the x and y axes and len specifies the label size. The
default
2009 Sep 09
1
Monkey patching +.POSIXt
Hi all,
This summer I've been working with a grad student to bring more of the
date time classes from JODA (http://joda-time.sourceforge.net/) into
R. To make these work seamlessly with existing date time objects, we
need to patch +.POSIXt. (The ruby community uses the term
monkey-patching for this sort of ill-advised, by sometimes necessary,
internal hackery, hence the title.) The problem is
2002 Feb 22
2
Tcl/Tk window lingering too long
I want to set up a simple Tk dialog interface to a function in R,
such that when the "OK" button is pressed, the dialog window is
destroyed and then R does its work on the data/parameters/whatever
that were entered in the dialog. The function "test" below is a
simple prototype.
My problem: upon running test() and hitting "OK", R does its work
(ie, computes
2001 Aug 09
1
bug (and fix) in seq.POSIXt (PR#1046)
I can't reach r-project.org at the moment so cannot check whether this
is a known bug.
> version
_
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
status
major 1
minor 3.0
year 2001
month 06
day 22
language R
The
2009 Mar 15
1
Conversion and rounding of POSIXct
POSIXct/lt supports fractional seconds (see Sub-second Accuracy
section of man page), but there seem to be some inconsistencies in
their handling.
Converting to POSIXlt and back does not give back the same time for
times before the origin:
> t0 <- as.POSIXct('1934-01-05 23:59:59.00001')
> t0
[1] "1934-01-06 00:00:00 EST" # rounding issue, see below
>
2007 Mar 19
3
R4.1: seq.POSIXt, tz="AEST" (PR#9572)
Times from seq.POSIXt come out wrong in AEST timezone around Feb 29 every
leap year before 1970 (on Windows XP).
According to help(DateTimeClasses), this is handled by "our own C code".
> x <- as.POSIXct("1968-02-27") # tz="AEST"
> x.gmt <- as.POSIXct("1968-02-27", tz="GMT")
> data.frame(
GMT=seq(x.gmt, by="day",
2007 Feb 21
1
Adding difftime objects to POSIXt objects
Hello,
?DateTimeClasses states that "one can add or subtract a number of
seconds or a 'difftime' object from a date-time object, but not add two
date-time objects."
So, is the below expected behavior?
> x <- Sys.time()
> x
[1] "2007-02-21 16:19:56 CST"
> x + as.difftime("1","%H")
[1] "2007-02-21 16:19:57 CST"
Warning