similar to: question about sorting POSIXt vector

Displaying 20 results from an estimated 10000 matches similar to: "question about sorting POSIXt vector"

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
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 <-
2020 Oct 02
2
timezone tests and R-devel
Yes, the potential issue I see is that make check fails when I explicitly set TZ. However, I set it to be the same as what the system reports when I login. Details: The system (RHEL) I am working on has $ strings /etc/localtime | tail -n 1 EST5EDT,M3.2.0,M11.1.0 $ date +%Z EDT $ echo $TZ US/Eastern On Fri, Oct 2, 2020 at 9:48 AM Sebastian Meyer <seb.meyer at fau.de> wrote: > Thank
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
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
2008 Feb 21
2
Unable to create/index a zoo irregular timeseries
In the text file pressione2008.csv I have the following "Data","MAX","MIN","Note" "07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta" "07-01-2008 18:00:00", 135, 85, "" "08-01-2008 08:00:00", 125, 75, "" which is a collection of blood pressure data at different time of the day. I would
2004 May 27
2
axis.POSIXct: Datetime data and plotting
I've run into a problem with the datetime axis generated by axis.POSIXct. It appears a similar issue was discussed in October 2003 under the subject line "datetime data and plotting" (see https://stat.ethz.ch/pipermail/r-help/2003-October/039071.html), but I wasn't able to determine whether there is a straightforward solution. The code below produces a graph with apparently
2004 Mar 05
3
as.POSIXct problem
Hi all, I'm having difficulty converting a 'dates' object to a POSIXct object: testDATES<-c(35947,35971,36004,36008,36053,36066) testDATES<-chron(dates=testDATES, format = c(dates = "m/d/y"), origin=c(month = 12, day = 30, year = 1899)) >[1] 06/01/98 06/25/98 07/28/98 08/01/98 09/15/98 09/28/98 > as.POSIXct(testDATES) [1] NA NA NA NA NA NA
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"
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",
2003 Oct 27
2
[[<-.data.frame with POSIXt replacement (PR#4808)
Hi, The following seems to be a bug introduced with version 1.8.0 (it worked without error on my installation of version 1.7.0): > test <- data.frame(time = I(c("2003-08-19:22:55:57"))) > test[["time"]] <- strptime(test[["time"]], format = "%Y-%m-%d:%H:%M:%S") Error in "[[<-.data.frame"(`*tmp*`, "time", value =
2004 Apr 29
1
Entering times around the start of daylight savings time
I'm having problems entering dates and times around when daylight savings time starts. If I type (on R 1.8.1 on Gentoo Linux) > ISOdatetime(2004,4,4,0:4,0,0,"GMT") [1] "2004-04-03 19:00:00 EST" "2004-04-03 20:00:00 EST" [3] "2004-04-03 22:00:00 EST" "2004-04-03 22:00:00 EST" [5] "2004-04-03 23:00:00 EST" Giving the times
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 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 <-
2004 Nov 08
3
misleading output after ordering data frame
Dear R users, I have a data frame which I create with read.csv and then order by date: d <- na.omit(read.csv(...)) d <- d[order(as.Date(as.character(d$Date), format="%d-%b-%y"), decreasing=F, na.last=F),] My problem is that even though the data frame is ordered as requested, the old row numbers are preserved. For example: * Before sorting: > d[1:3,] Date Amt 1
2007 Aug 08
2
Error: Cannot Coerce POSIXt to POSIXct when building package
A newbie here - please forgive me if this is a basic question. We have an in house package built in R 2.2.1 (yes we're a little behind the times at our firm)and would like to rebuild it using R 2.5.1. However, when I try and build the package from source, I keep getting this error: Error in as(slotVal, slotClass, strict = FALSE) : no method or default for coercing "POSIXt"
2007 Jun 07
2
character to time problem
I am trying to clean up some dates and I am clearly doing something wrong. I have laid out an example that seems to show what is happening with the "real" data. The coding is lousy but it looks like it should have worked. Can anyone suggest a) why I am getting that NA appearing after the strptime() command and b) why the NA is disappearing in the sort()? It happens with na.rm=TRUE
2005 Jan 11
5
global objects not overwritten within function
Dear useRs, I have a function that creates several global objects with assign("obj",obj,.GlobalEnv), and which I need to run iteratively in another function. The code is similar to f <- function(...) { assign("obj",obj,.GlobalEnv) } fct <- function(...) { for (i in 1:1000) { ... f(...) ...obj... rm(obj) #code fails without this line } } I don't understand
2008 Sep 10
3
(PR#12770) format() under Windows giv wrong resuts with
On Windows XP SP3 > format(pippo, format="%I:%M:%S %p") [1] "11:43:12 PM" In any case, if there is a problem it is in Windows, not in R, since this is an Windows service that is being called. So there is no evidence at all of any bug in R here. On Wed, 10 Sep 2008, pego.enrico at tiscali.it wrote: > Full_Name: Enrico Pegoraro > Version: 2.7.2 > OS: Windows