similar to: problem with rbind when data frame contains an date-time variable "POSIXt" "POSIXlt"

Displaying 20 results from an estimated 20000 matches similar to: "problem with rbind when data frame contains an date-time variable "POSIXt" "POSIXlt""

2006 Jul 23
1
diff, POSIXct, POSIXlt, POSIXt
Dear Listers, I have encountered a strange problem using diff() and POSIXt: dts<-c("15/4/2003","15/7/2003","15/10/2003","15/04/2004","15/07/2004","15/10/2004","15/4/2005","15/07/2005","15/10/2005","15/4/2006") dts <- strptime(dts, "%d/%m/%Y") class(dts) [1] "POSIXt"
2006 Jul 23
1
diff, POSIXct, POSIXlt, POSIXt
Dear Listers, I have encountered a strange problem using diff() and POSIXt: dts<-c("15/4/2003","15/7/2003","15/10/2003","15/04/2004","15/07/2004","15/10/2004","15/4/2005","15/07/2005","15/10/2005","15/4/2006") dts <- strptime(dts, "%d/%m/%Y") class(dts) [1] "POSIXt"
2011 Mar 08
1
Date arithmetic coerces POSIXlt to POSIXct?
Hi. This feels like a bug to me, or at least an undocumented feature, but I thought I'd see what people here thought of it. Consider a POSIXlt object like this one: > a <- as.POSIXlt ("2011-01-23 12:45:45") > class (a) [1] "POSIXlt" "POSIXt" Fine. Now, if I do some arithmetic on that object, the result is converted to POSIXct. > class (a
2012 Nov 05
1
Dates as POSIXt
When I try to do linear interpolation between financial contracts with maturities on different dates in different months I have come across some behavior I haven't seen before. I have a data frame in R which is loaded from an access database so I can't provide a working example. It was loaded using this code: > dbPath <- "H:/pathToDB/DB.mdb" > channel <-
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
2004 Oct 05
2
correct my method of estimating mean of two POSIXlt data frames
Hello, I searched the archives but could not come to a solution. I have to two columns of information t_start_cdt looks like: > t_start_cdt[1:4] [1] "2003-07-09 11:02:25" "2003-07-09 11:10:25" "2003-07-09 11:30:25" [4] "2003-07-09 12:00:25" > class(t_start_cdt) [1] "POSIXt" "POSIXlt" t_end_cdt looks like: > t_end_cdt[1:4]
2007 Jan 04
3
problem with plot() and POSIXt dates
Hy all, I'm plotting graphs using plot() function, they are on X axes POSIX dates: "POSIXt" "oldClass" "POSIXct" "POSIXlt" I can't figure out why sometimes it prints the month and days and sometimes it prints the unix timestamp. It appens usually when the xlim is short like only some days. xlim is settled as a POSIXt like this "2006-12-30
2008 Mar 18
4
cut.Date and cut.POSIXt problem
cut.Date and cut.POSIXt indicate that the breaks argument can be an integer followed by a space followed by "year", etc. but it seems the integer is ignored. For example, I assume that breaks = "3 months" is supposed to cut it into quarters but, in fact, it cuts it into months as if 3 had not been there. > d <- seq(Sys.Date(), length = 12, by = "month") >
2006 Nov 09
1
POSIXlt converted to POSIXct in as.data.frame()
In trying to use as.Date(), I've come across the conversion of POSIXlt to POSIXct when a POSIXlt variable is included in a data frame: my_POSIX <- strptime(c("11-09-2006", "11-10-2006", "11-11-2006", "11-12-2006", "11-13-2006"), "%m-%d-%Y") str(my_POSIX) my_Date <- as.Date(my_POSIX) str(my_Date) data <- format(my_Date)
2006 Dec 07
2
Matplot does not work with x being POSIXt class (PR#9412)
Hi, Matplot works with x being Date class but not POSIXt. Here is the example with R version 2.5.0 Under development (unstable) (2006-12-06 r40129) Example: x <- Sys.Date() - c(1:10) y <- cbind(1:10, 10:1) class(x) ## [1] "Date" matplot(x, y) x <- strptime(as.character(x), format="%Y-%m-%d") ## [1] "POSIXt" "POSIXlt" matplot(x, y) Error in
2005 Feb 10
3
question about sorting POSIXt vector
Dear useRs, How come the first attempt to sort a POSIXt vector fails (Error: non-atomic type in greater), while the second succeeds? (Code inserted below.) The documentation says that POSIXt is used to allow operations such as subtraction, so I'd expect sorting to work. Is this perhaps an OS issue? (I run R 2.0.1 on Win xp.) Thank you, b. #------------code test <- c("2005-02-08
2004 Apr 23
3
time zones in POSIXt
Hi, I have two data sources. One records time in PST time zone, the other in GMT. I want to compute the difference between the two, but don't see how. Here is an example where I compute time difference between identical times each (meant to be) relative to its time zone. > as.POSIXlt("2000-05-10 10:15:00", "PST") - as.POSIXlt("2000-05-10 10:15:00",
2012 Feb 24
6
strange behaviour of "POSIXlt" "POSIXt" object
Hi, Does anybody know why get I this kind of strange situation: Browse[2]> hcEnd [1] "2009-03-29 06:30:00" Browse[2]> class(hcEnd) [1] "POSIXlt" "POSIXt" Browse[2]> is.na(hcEnd) [1] TRUE This issue is the source of my all issues in my program, Thanks for your help -- View this message in context:
2011 Feb 14
3
how to order POSIXt objects ?
I have a problem ordering by descending magnitude a POSIXt object. Can someone help please and let me know how to work around this. My goal is to be able to order my data by DATE and then by descending TIME. I have tried to include as much info as possible below. The problem stems from trying to read in times from a CSV file. I have converted the character time values to a POSIXt object using the
2012 Jun 15
2
POSIXlt and trunc
Hi, I'm having trouble understanding how trunc is operating on vectors of POSIXlt objects. Why does dates[1:4] in the last line return a bunch of NAs even though dates look like it has all the right elements? This worries me that something is off with my use of trunc. Is trunc not suppose to be vectorized with POSIXlt? If not, then how should I truncate a bunch of POSIXlt objects? I'm
2009 Nov 19
6
Surprising length() of POSIXlt vector (PR#14073)
Arrays of POSIXlt dates always return a length of 9. This is correct (they're really lists of vectors of seconds, hours, and so forth), but other methods disguise them as flat vectors, giving superficially surprising behaviour: strings <- paste('2009-1-', 1:31, sep='') dates <- strptime(strings, format="%Y-%m-%d") print(dates) # [1]
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",
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",
2010 Oct 28
1
Unexpected behabiour of min, tapply and POSIXct/POSIXlt classes?
Hello, I found rather surprising the behaviour of POSIXct and POSIXlt classes when combined with min and tapply. The details can be deduced from the script below: ############# Start of the script #################### before <- Sys.time() Sys.sleep( 1 ) now1 <- now2 <- Sys.time() my.times <- c( before, now1, now2 ) class( my.times ) ## [1] "POSIXct"
2009 Dec 22
1
as.Date function yields inconsistent results (PR#14166)
Full_Name: Mario Luoni Version: 2.10.0 OS: Windows XP HE SP3 Submission from: (NULL) (217.194.59.134) This piece of code: zzz1 <- as.POSIXct("1999-03-18", tz="CET") zzz2 <- as.POSIXlt("1999-03-18", tz="CET") zzz1 == zzz2 as.Date(zzz1) as.Date(zzz2) yields TRUE for "zzz1==zzz2", but the two dates returned by as.Date are different: >