search for: posixt

Displaying 20 results from an estimated 533 matches for "posixt".

Did you mean: posix
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 I can't figure out how to override +.POSIXt so that it gets called from +. Simply including a new +.POSIXt function in the package doesn...
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 characte...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
...n Maechler <maechler at stat.math.ethz.ch> wrote: >> >>>>>>> Ji?? Moravec >>>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: >> >>> This is my first time working with dates, so if the answer is "Duh, work >>> with POSIXt", please ignore it. >> >>> Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? >> >>> Is this because `Date` is (mostly) a virtual class setup for a better >>> inheritance or is that something that is just missing? (like >>&...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
...round() method, which only takes the 'digits' argument. Here's an example: > date <- Sys.Date() > class(date) [1] "Date" We see that there are only two round() methods in addition to the implicit built-in one; > methods("round") [1] round.Date round.POSIXt see '?methods' for accessing help and source code Looking at round() for 'Date'; > round.Date function (x, ...) { .Date(NextMethod(), oldClass(x)) } <environment: namespace:base> we see that it defers to the next method here, which is the built-in one. The built-in o...
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: http://r.789695.n4.nabble.com/strange-behaviour-of-POSIXlt-POSIXt-object-tp4418115p4418115.html Sent from the R help mailing list archive at...
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...
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 17...
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.min...
2007 Feb 21
1
Adding difftime objects to POSIXt objects
...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 message: Incompatible methods ("+.POSIXt", "Ops.difftime") for "+" "+.POSIXt" does behave as expected, though: > "+.POSIXt"(x,as.difftime("1","%H")) [1] "2007-02-21 17:19:56 CST" > R.version _ platform i686-pc-linux-gnu arch...
2010 Feb 01
1
Error with cut.POSIXt and daylight savings time switchover dates
...merica/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 time (start) is converted to a POSIXlt, and the individual members are manipulated. Because a spacing of "1 day" is requested, the hour, minute, and second are manually set to 0. In doing so, the represented time is now before the 2:00am PDT->PST change. This value is...
2024 Feb 08
2
round.Date and trunc.Date not working / implemented
...2024, at 15:15, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>> Ji?? Moravec >>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: > >> This is my first time working with dates, so if the answer is "Duh, work >> with POSIXt", please ignore it. > >> Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? > >> Is this because `Date` is (mostly) a virtual class setup for a better >> inheritance or is that something that is just missing? (like >> `sort.data.frame...
2009 Oct 15
2
forwarded: bug (?) in cut.POSIXt with "breaks"=integer
From: Vitalie S. <vitosmail <at> rambler.ru> Subject: Bug in cut.POSIXt Newsgroups: gmane.comp.lang.r.general Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago) Hello Everyone, Before reporting decided to post here first: tt <- structure(c(1254238817, 1254238859, 1254238969, 1254239080), class = c("POSIXt",...
2009 Nov 19
0
Wishlist: In documentation, say that `+.Date`(Date, difftime) should be called directly or remove 'or an object of class "difftime"' (PR#14072)
Full_Name: Suharto Anggono Version: 2.8.1 OS: Windows Submission from: (NULL) (125.161.134.206) About PR#14067, now I understand why (Date + difftime) does not use '+.Date'. But, before I understand, it was surprising. The surprise is also reflected in the post "Problem with +(POSIXt, difftime) dispatching -- WAS: How to create sequence of constant time interval" in R-help 2009-02-17. This is taken from the documentation of Ops.Date. Usage date + x ... Arguments date date objects ... x a numeric vector (in days) or an object of class "difftime". ... Readin...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
...ument. > > Here's an example: > >> date <- Sys.Date() >> class(date) > [1] "Date" > > We see that there are only two round() methods in addition to the > implicit built-in one; > >> methods("round") > [1] round.Date round.POSIXt > see '?methods' for accessing help and source code > > Looking at round() for 'Date'; > >> round.Date > function (x, ...) > { > .Date(NextMethod(), oldClass(x)) > } > <environment: namespace:base> > > we see that it defers to the...
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" &quo...
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, 12L, 12L), mday = c(13L, 13L, 13L, 13L, 13L, 13L, 13L, NA, 13L,...
2007 Aug 08
2
Error: Cannot Coerce POSIXt to POSIXct when building package
...age 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" to "POSIXct" Error : unable to load R code in package 'Mango' Error: package/namespace load failed for 'Mango' I tried defining a new method "as.POSIXct" in the package to coerce POSIXt to POSIXct and then added the as.POSIXct method to the "NAMSPACE...
2012 Nov 05
1
Dates as POSIXt
...ss database so I can't provide a working example. It was loaded using this code: > dbPath <- "H:/pathToDB/DB.mdb" > channel <- odbcConnectAccess(dbPath) > DF = sqlFetch(channel,'nameOfTable') When I look at the Date column I get this result > str(DF$Date) POSIXt[1:25311], format: "2003-09-03 06:00:00" "2003-09-03 06:00:00" ... I have newer seen data as POSIXt, only as POSIXct or POSIXlt. It is the behavior of this class is that I would like more information about. Online searching have only told me that it is a virtual class. When I...
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. #-------...
2005 Apr 14
1
xtable POSIXt
...ike to print out data frame with POSIXct column in html format using xtable package, but I got error message when trying to print the table. Here is example: aaa<-data.frame(as.POSIXct(strptime('03 2005', '%d %Y')),0) aaa.tab<-xtable(aaa) print(aaa.tab) Error in Math.POSIXt(x + ifelse(x == 0, 1, 0)) : abs not defined for POSIXt objects I was able to get around the problem with converting column back to string but still I would like to know is it a bug or I was doing something wrong. thanks, -- Miha Razinger Environmental Agency of Slovenia Office of M...