Displaying 20 results from an estimated 10000 matches similar to: "Conversion a ts time to another class."
2009 Jul 23
1
Changing ts times to dates
Dear all,
Ive just started with R and I have question:
how can you change a time from a ts object .i.e 2009.004 to "2009-01-01"? Is
there any function for this? I tried around with as.Date... but it hasnt
worked.
Thank you beforehand.
Chuse.
[[alternative HTML version deleted]]
2009 Jul 24
0
TS- dates
Dear R collegues,
I am trying to change a ts time such as 2009.004 to a str or POSIX class
"2009-01-01".
Is there any function or method to do it?. Thank you beforehand.
Chuse.
[[alternative HTML version deleted]]
2011 Feb 09
3
precision of gamma function
Dear R users,
I have to calculate gamma functions for negative numbers beyond -171.4.
e.x. gamma(-500.4)
I got following:
> gamma(-170.4)
[1] -5.824625e-308
> gamma(-171.4)
[1] 0
Warning message:
underflow occurred in 'gammafn'
I have tried to use a recursion getting values a little futher -180.
How could I solve this problem? Thank you beforehand.
Chuse.
2011 Mar 02
1
Refine ARMA model
Dear users,
I tried to fit an AR(2) model to data. This the result:
> arima(vw,c(3,0,0))
Call:
arima(x = vw, order = c(3, 0, 0))
Coefficients:
ar1 ar2 ar3 intercept
0.1052 -0.0102 -0.1203 0.0099
s.e. 0.0337 0.0339 0.0338 0.0018
sigma^2 estimated as 0.002934: log likelihood = 1293.16, aic = -2576.33
Now, ar2 is not significantly different from
2002 Aug 27
1
ts basic question
Dear R collegues,
I'd like to use the time-series facilities of R and I'm not sure how to
set my dataset properly.
I have monthly data, so the description could be: ts(data,
start=c(1951,1), frequency= 12)
However, the data is a matrix of years (rows) and months (columns), as
follows:
> s1 <- read.table("stdata.txt", header=TRUE)
> s1[1:3, ]
YEAR JAN FEB MAR APR
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
2011 Feb 02
1
Acf of Frima
Hello,
I am trying to calculate the autocovariance matrix for any general
farima(p,d,q) with
p,q > 1. Could anyone give an idea how to implement in R or if there
is any package for this?
thank you beforehand.
Jose.
2002 May 03
1
Daylight savings time and conversion to POSIXt (arghh!)
I have asked this question before, and received some suggestions for
work-arounds that get the job done--and they are much appreciated.
But I would still like to find out if I'm missing something, and
whether there is a direct way using POSIXt functions (as.POSIXct,
as.POSIXlt, strptime, in particular).
I have environmental data collected once per minute. Here is a subset
of 3 input
2009 Sep 11
1
What determines the unit of POSIXct differences?
Dear All,
what determines if a difference between POSIXct objects gets
expressed in days or seconds?
In the following example, it's sometimes seconds, sometimes days.
as.POSIXct('2009-09-01') - as.POSIXct(NA)
Time difference of NA secs
c(as.POSIXct('2009-09-01'), as.POSIXct(NA)) -
c(as.POSIXct('2009-09-01'), as.POSIXct('2009-08-31'))
Time differences in
2006 Oct 19
3
Time conversion from Win32 64bit FILETIME?
Windows-32 has a time structure called FILETIME, a 64-bit value
representing the number of 100-nanosecond intervals since January 1,
1601 (UTC). That is not a typo, the year is 1601.
Does anyone have a clue(or algorhithm)for how this is converted to
something a little more POSIX-like ?
Thank you,
Derek
--
Derek N. Eder
Gothenburg University
VINKLA - Vigilance and Neurocognition
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
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
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 May 20
2
Class for time of day?
What is the recommended class for time of day (independent of calendar
date)?
And what is the recommended way to get the time of day from a POSIXct
object? (Not a string representation, but a computable representation.)
I have looked in the man page for DateTimeClasses, in the Time Series
Analysis Task View and in Spector's Data Manipulation book but haven't found
these. Clearly I can
2004 Sep 14
2
R post-hoc and GUI
Hi *
i've done my anova anlysis but now i need post-hoc test, are these
included in R ?
I've a Big problem, working with people that don't like to use
command-line software (but prefer something like openoffice) does
someone is trying to do a usable GUI for R ? i'm reading something on R
commander SciView and others but all seem to be beta. I'd like to make
possible to make
2004 Aug 19
2
proposed change to [.POSIXct
R developers,
The "tzone" attribute is stripped from a POSIXct object when the subscript
command is called ("[.POISXct"). This results in dates being printed in the
locale specific format after a subscript operation is applied to a POSIXct
object which has cause several problems for me in the past.
Here is an example of this problem under R 1.9.1:
> x <-
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()
2003 Oct 28
3
ts vs. POSIX
OK.
What if I have a time series which is collected every Monday, please?
What is the proper way to use the start option within the ts command
in order to indicate that this is Monday data, please?
Thanks again!
Sincerely,
Erin
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]
2019 May 01
3
anyNA() performance on vectors of POSIXct
Inside of the anyNA() function, it will use the legacy any(is.na()) code if
x is an OBJECT(). If x is a vector of POSIXct, it will be an OBJECT(), but
it is also TYPEOF(x) == REALSXP. Therefore, it will skip the faster
ITERATE_BY_REGION, which is typically 5x faster in my testing.
Is the OBJECT() condition really necessary, or could it be moved after the
switch() for the individual TYPEOF(x)