similar to: Warning 'as.data.frame.POSIXct()' is deprecated

Displaying 20 results from an estimated 600 matches similar to: "Warning 'as.data.frame.POSIXct()' is deprecated"

2023 Jul 06
2
logic tweak needed for as.data.frame.<class> deprecation warning
Continuing the thread started on R-package-devel, here: https://stat.ethz.ch/pipermail/r-package-devel/2023q3/009307.html The logic of the now soft-deprecated as.data.frame.<class>, > body(as.data.frame.integer)[[2L]] if ((sys.nframe() <= 1L || sys.call(-1L)[[1L]] != quote(as.data.frame)) && nzchar(Sys.getenv("_R_CHECK_AS_DATA_FRAME_EXPLICIT_METHOD_")))
2008 Jan 08
1
retaining "POSIXct" formatting when using apply(muff, FUN=MAX) on POSIXct dataframe?
How do I retain "POSIXct" formatting when using apply, with FUN=max? #example: mydata <- rep(Sys.time(), 10) mydf <- data.frame(matrix(data=mydata, nrow=2, ncol=length(mydata) ) ) for(i in seq(mydf))class(mydf[[i]]) <- class(mydata) str(mydf) maxdates <- apply(mydf,2,max,na.rm=T) str(maxdates) #Why is the formattign now "chr", and not
2011 Jul 15
2
Odd behaviour of as.POSIXct
Dear all, how come the first loop in the below fails, but the second performs as expected? days <- as.Date( c("2000-01-01", "2000-01-02") ) for(day in days) { as.POSIXct(day) } for( n in 1:length(days) ) { show(as.POSIXct(days[n])) } Many thanks, Jo [[alternative HTML version deleted]]
2011 Jun 01
1
Problem with as.POSIXct()
Hi, when I type in these words: > a=c("2011-06-01 17:21:24.83", "2011-06-01 17:21:24.283") > as.POSIXct(a) the real output is: [1] "2011-06-01 17:21:24.830 CST" "2011-06-01 17:21:24.283 CST" rather than the expected one: [1] "2011-06-01 17:21:24.083 CST" "2011-06-01 17:21:24.283 CST" How can I deal with such
2011 May 27
0
lubridate, as.POSIXct and a vector of times: bug or feature??
It took me some time to realize this annoying behavior was coming from lubridate. Perhaps this behavior is unexpected a result of cursory knowledge of it.... ## The expected behavior > sometimes=c(0,1,2,3)*60*60*24 > as.POSIXct( sometimes, origin='1970-01-01', tz='GMT') [1] "1970-01-01 GMT" "1970-01-02 GMT" "1970-01-03 GMT" "1970-01-04
2005 Oct 17
1
as.POSIXct before and after 1970
Can someone, please, explain the difference in as.POSIXct results before 1970 and on and after 1970 as illustrated below. After 1970, the use of 'EST' or "EST+5EDT' as the timezone does not affect the result of asPOSIXct, but before 1970 on 10/28 the results are different. > as.POSIXct('1970-10-29', tz='EST')+1 [1] "1970-10-29 00:00:01 EST" >
2006 Aug 23
1
how to get a histogram of an POSIXct vector ?
Hi, search on web indicates that R also includes a hist method on POSIXct vectors. My (perhaps too unexperienced) approach below yields an error. Could somebody give me a hint what's wrong ? Peter > str(samples) `data.frame': 7500 obs. of 1 variable: $ DateTime:'POSIXct', format: chr "2006-07-20 00:10:08" "2006-07-20 00:11:17" "2006-07-20
2011 Aug 24
1
as.numeric() and POSIXct format
Hi! I'm confused by this: > as.numeric(as.POSIXct(518400,origin="2001-01-01")) [1] 978822000 I guess the problem is that as.numeric() assumes a different origin, but cannot find any default origin. How can I get back the seconds from the POSIXct format? In other words, which the inverse function of as.POSIXct()? I've tried as.numeric and unclass() using a origin=
2004 May 07
0
loess and as.POSIXct
Hi there fellow R-users, I have just upgraded to R version 1.9.0 from R version 1.7.1 for Windows. Im trying to use the loess smoother where the X-variable is an as.POSIXct variable. The following works fine with R1.7.1 but not with R1.9.0. Here is the example: dates<-c('2003-08-03','2003-08-10','2003-08-17','2003-08-24','2003-08-31','2
2006 Oct 04
2
integers to POSIXct
What is the recommended way to convert/coerce and integer to a POSIXct please? d <- as.POSIXct(Sys.Date()) i <- as.integer(d) as.POSIXct(i) Error in as.POSIXct.default(i) : do not know how to convert 'i' to class "POSIXlt" This appears to be the behaviour in 2.3.1 and 2.4.0 on windows XP. I have tried searching on this and found as.Date.integer in package zoo which
2010 Apr 23
1
segfault with format.POSIXct()
Hi, I posted in R-devel, thinking it might be a general R problem, but Uwe cannot reproduce it in his GNU/Linux distro, with the same R version. So I'm posting here to ask whether Debian R users are having this problem. I'm getting a segmentation fault as follows: ---<--------------------cut here---------------start------------------->--- R> begt <-
2001 Oct 09
0
Problems merging with POSIXct objects and all = TRUE (PR#1121)
I am having problems using merge with all = TRUE when one of the dataframes has objects of class POSIXct. Here is an example: > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1 minor 3.0 year 2001
2004 Jun 13
1
can't create a POSIXct from an actual Unix timestamp (PR#6975)
Full_Name: Philip Gross Version: 1.9.0 OS: Linux Redhat 9.0 Submission from: (NULL) (65.57.245.11) Among the many conversions for POSIXct values, there does not seem to be one which will accept an actual POSIX timestamp, e.g. as produced by MySQL's UNIX_TIMESTAMP() function. I have fixed this by adding the following lines to R-1.9.0/src/library/base/R/datetime.R , at line 89:
2006 Nov 27
2
as.Date: conversion pb from POSIXct (PR#9386)
Full_Name: Xiao Gang FAN Version: 2.4.0 OS: Windows Submission from: (NULL) (159.50.101.9) > library(chron) > as.Date(as.POSIXct(strptime("1994-01-24","%Y-%m-%d"))) [1] "1994-01-23"
2008 Sep 16
1
aggregate() does not return POSIXct object correctly (PR#12887)
Full_Name: Rene Locher Version: 2.7.2 Patched (2008-09-12 r46541) OS: XP Submission from: (NULL) (160.85.231.40) dat <- data.frame(event=factor(c("A","A","B")), time=as.POSIXct(c("2008-01-10","2008-01-01","2008-01-04"))) min(dat$time) ## "2008-01-01 CET" ## as expected
2009 Mar 10
1
?as.POSIXct (PR#13587)
Full_Name: Luca Braglia Version: 2.8 OS: Windows Submission from: (NULL) (85.18.136.110) >From ?as.POSIXct ## SPSS dates (R-help 2006-02-17) z <- c(10485849600, 10477641600, 10561104000, 10562745600) as.Date(as.POSIXct(z, origin="1582-10-14", tz="GMT")) ^^ It should be 15 (Gregorian calendar adoption day, when
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 >
2009 Oct 20
0
plot.POSIXct uses wrong x axis (PR#14016)
Full_Name: Karl Ove Hufthammer Version: 2.10.0 beta OS: Windows Submission from: (NULL) (93.124.134.66) When plotting a single POSIXct variable, 'plot' uses a nonsensical x axis. Here is some example code: set.seed(1) x=seq(1,1e8,length=100)+round(runif(100)*1e8) y=as.POSIXct(x,origin="2001-01-01") plot(y) The y axis correctly shows appropriate labels (years 2002 to 2006),
2010 Apr 22
1
segfault with format.POSIXct()
Hi, I'm getting a segmentation fault as follows: ---<--------------------cut here---------------start------------------->--- R> begt <- as.POSIXct(strptime("10/01/2009 06:00:00", format="%d/%m/%Y %H:%M:%S"), + tz="GMT") R> tser <- seq(begt, by=5, length.out=91000) R> tser.trunc <- format(tser) Error: segfault from C
2013 Mar 26
0
as.Date.POSIXct
Would it make sense for as.Date.POSIXct to not assume tz="UTC" if the POSIXct object has a valid tzone attribute? Current behavior may be confusing in certain cases, for example: > (d <- structure(1090450800, tzone="Europe/Berlin", + class=c("POSIXct","POSIXt"))) [1] "2004-07-22 01:00:00 CEST" > as.Date(d) [1] "2004-07-21" >