Displaying 20 results from an estimated 9000 matches similar to: "proposed change to [.POSIXct"
2004 Aug 17
3
Fwd: strptime() problem?
Hi all;
I've already send a similar e-mail to the list and Prof. Brian Ripley
answered me but my doubts remain unresolved. Thanks for the clarification,
but perhaps I wasn't clear enough in posting my questions.
I've got a postgres database which I read into R. The first column is
Timestamp with timezone, and my data are already in UTC format. An 'printed'
extract of R
2008 Feb 16
3
Arithmetic bug? (found when use POSIXct) (PR#10776)
Full_Name: Bo Zhou
Version: 2.6.1 (2007-11-26)
OS: Windows XP
Submission from: (NULL) (207.237.54.242)
Hi,
I found an arithmetic problem when I'm doing something with POSIXct
The code to reproduce it is as follows (This is the recommended way of finding
out time zone difference on R News 2004-1 Page 32 URL
http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf)
a=Sys.time()
2012 Jul 09
1
c(a, b) for POSIXct objects with tzone attributes?
Hello:
What is the recommended method for retaining the tzone attributes
when concatonating POSIXct objects?
> (d1 <- ISOdate(1970,1,1)) # Sets the tzone attribute = GMT
[1] "1970-01-01 12:00:00 GMT"
> (d1.2 <- c(d1, d1)) # c(..) strips the tzone attribute, displays in
the time zone of the operating system
[1] "1970-01-01 04:00:00 PST" "1970-01-01
2002 May 21
1
I() fails on objects of class POSIXct (PR#1587)
Although the documentation is somewhat sketchy, I() can be used to create
objects of class AsIs:
> I("a")
[1] "a"
attr(,"class")
[1] "AsIs" "character"
> I(4)
[1] 4
attr(,"class")
[1] "AsIs" "numeric"
> I(4 + 0i)
[1] 4+0i
attr(,"class")
[1] "AsIs" "complex"
>
This
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
2010 Mar 18
1
how to return "date" part of POSIXct
How do I get a number representing a date from a POSIXct i.e. removing the
time elements?
--
View this message in context: http://n4.nabble.com/how-to-return-date-part-of-POSIXct-tp1598109p1598109.html
Sent from the R help mailing list archive at Nabble.com.
2023 Apr 28
2
range() for Date and POSIXct could respect `finite = TRUE`
Hi all,
I noticed that `range.default()` has a nice `finite = TRUE` argument,
but it doesn't actually apply to Date or POSIXct due to how
`is.numeric()` works.
```
x <- .Date(c(0, Inf, 1, 2, Inf))
x
#> [1] "1970-01-01" "Inf" "1970-01-02" "1970-01-03" "Inf"
# Darn!
range(x, finite = TRUE)
#> [1] "1970-01-01"
2003 Apr 30
2
ylab in plot.POSIXct
I am using R-1.7.0 and have some data which consist of one vector of
numbers and a second corresponding vector of dates belonging to the
POSIXct class. I would like to plot the numbers against the dates.
What is the best way to do this?
It almost works to just call `plot.' However if I do this while using
the `ylab' parameter I get a warning message:
parameter "ylab"
2023 May 19
1
range() for Date and POSIXct could respect `finite = TRUE`
Hi All,
I think there may be some possible confusion about what allowsInf would be
reporting (or maybe its just me :) ) if we did this.
Consider a class "myclass", S3, for starters,
with
setMethod("allowsInf", "myclass", function(obj) FALSE)
Then, what would
myclassthing <- structure(1.5, class = "mything")
myclassthing[1] <- Inf
do. Assumely it
2011 May 31
3
DateTime Math in R - POSIXct
Greetings -
I'm battling POSIXct, as per the code below. My input is actually an XL
file, but the weird results below correctly model what I am seeing in my
program.
Before I punt and use lubridate or timeDate, could anyone please help me
understand why POSIXct forces my variable back to GMT?
I suspect that I'm not properly coding the tzone value, but it does not
throw an
2010 Sep 03
1
Incorrect formatted output after subtracting non-integer seconds from POSIXt origin
> x<-as.POSIXct("1970-1-1", tz="UTC")-.5
> y<-as.POSIXct("1970-1-1", tz="UTC")+.5
> x==y
[1] FALSE # of course
but x and y "appear" to be the same when formatted, even with extra
precision:
> format(x, format="%Y-%m-%d %H:%M:%OS2")
[1] "1970-01-01 00:00:00.50"
> format(y, format="%Y-%m-%d
2023 Apr 28
1
range() for Date and POSIXct could respect `finite = TRUE`
A tiny nit-pick: Seems to me that end date = NA would mean the event has
not yet ended, whilst Inf would mean that the event is known to never
terminate, ie: an eternal fact, or physical law.
On Fri, Apr 28, 2023 at 10:12?AM Davis Vaughan via R-devel <
r-devel at r-project.org> wrote:
> Hi all,
>
> I noticed that `range.default()` has a nice `finite = TRUE` argument,
> but it
2004 May 19
2
POSIX to ts and back to POSIX
I am trying to use POSIX datetime objects rather than chron datetime
objects but am having difficulty with POSIX in a time series. My
question: Once a POSIXct vector is bound to a time series, is there a
function to convert back to POSIXct? The following code demonstrates
what I am trying to do.
> ts(as.POSIXct(strptime(tmp,"%m/%d/%Y %H:%M:%S")),freq=1440)
Time Series:
Start =
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
2018 May 16
2
Date method of as.POSIXct does not respect tz
R 3.5.0
Is it intended that the Date method of as.POSIXct does not respect the
tz parameter? I suggest changing as.POSIXct.Date to this:
function (x, tz = "", ...)
.POSIXct(unclass(x) * 86400, tz = tz)
Currently, the best workaround seems to be using the character method if
one doesn't want the default timezone (which is often an annoying DST
timezone).
This came up on
2002 Apr 29
2
Lotos 1-2-3 date to POSIXct
I have some data that was created for import into a Lotus 1-2-3 spreadsheet
and on of the columns is time. The
time is akin to Julian were the value 1 is mapped "01-Jan-00 12:00:00 AM" in
Lotus 1-2-3. Is there a function in an R package that can convert this
numeric vector to a POSIXct vector?
With best wishes and kind regards I am
Sincerely,
Corey A. Moffet
Instructor
Department
2006 Sep 22
2
behavior of [<-.foo
Can someone help me understand the following behavior of "[<-" ?
If I define a simple class based on a matrix, the [<- operation only
inserts into the first column:
> x <- matrix(rnorm(10),nrow=5,ncol=2)
> class(x) <- "foo"
> "[<-.foo" <- function(x, i, j, value) {
+ if(missing(i)) i <- 1:nrow(x)
+ if(missing(j)) j <-
2008 Jan 27
1
bug in difftime with as.POSIXct
I am trying to do ephemeris calculations in R, which involves calculating an
elapsed time. As illustrated below, difftime seems to have problems with my
method, since the fractional day is sometimes the correct 0.5 and sometimes
the incorrect 0.46.
I am doing this on with R-2.6.1 on a powerpc-apple-darwin8.10.1 system.
I get the same results for as.POSIXlt() instead of as.POSIXct(), but the
2008 Sep 12
2
From time-strings to Unix-Epoche-time?
Hello,
I have strings with date-/time-data from a logfile.
For a sort-by-time (and other time-related analysis)
I need something to convert the
times to the Unix-epoche-time (better also with parts
of seconds).
Is there something that does that job (or a similar conversion)
in R?
TIA,
Oliver Bandel
2012 Oct 30
2
POSIXct date missing "time component"
Hi,
I have some dates that are giving me a problem, in general the dates look
like this:
free.dates[60:61]
[1] "2009-05-21 23:45:00 GMT" "2009-05-22 00:00:00 GMT"
but for some reason, when taken "alone", they look like this:
free.dates[60]
[1] "2009-05-21 23:45:00 GMT"
free.dates[61]
[1] "2009-05-22 GMT" # the time component is gone, and