Displaying 20 results from an estimated 70000 matches similar to: "TS- dates"
2009 Jul 27
1
Conversion a ts time to another class.
Dear R collegues,
I am trying to change a ts time such as 2009.004 to a str or POSIX
class as "2009-01-01".
Is there any function or method to do it?. Thank you beforehand.
Chuse.
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]]
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
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.
2024 Jun 13
0
head.ts, tail.ts loses time
> It isn't really clear that it can't work. This does work by inserting NA's...
>
> library(zoo)
> as.ts(as.zoo(lynx)[ c(1:3, 7) ] )
If by 'this' you mean indexing, it would be very confusing and error prone for expressions like lynx[c(1:3, 7)] (lynx is from class 'ts') to return a ts object with NA's inserted and, even more so, since this has been
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 =
2024 Jun 10
1
head.ts, tail.ts loses time
zoo overcomes many of the limitations of ts:
library(zoo)
as.ts(head(as.zoo(presidents)))
## Qtr1 Qtr2 Qtr3 Qtr4
## 1945 NA 87 82 75
## 1946 63 50
xts also works here.
On Sun, Jun 9, 2024 at 12:04?PM Spencer Graves
<spencer.graves at prodsyse.com> wrote:
>
> Hello, All:
>
>
> The 'head' and 'tail' functions strip the time
2024 Jun 10
1
head.ts, tail.ts loses time
Hi, Gabor et al.:
Thanks for this. I should change my current application to use either
zoo or xts, as Gabor suggests.
However, I was surprised to learn that "[.ts" does NOT return an
object of class "ts". I see that "head.default" and "head.matrix" both
call "[", so "head" cannot return a ts object, because "["
2024 Jun 10
1
head.ts, tail.ts loses time
Hi, Martin et al.:
On 6/10/24 9:32 AM, Martin Maechler wrote:
>>>>>> Spencer Graves
>>>>>> on Mon, 10 Jun 2024 07:50:13 -0500 writes:
>
> > Hi, Gabor et al.: Thanks for this. I should change my
> > current application to use either zoo or xts, as Gabor
> > suggests.
>
>
> > However, I was
2024 Jun 11
1
head.ts, tail.ts loses time
It isn't really clear that it can't work. This does work by inserting NA's.
library(zoo)
as.ts(as.zoo(lynx)[ c(1:3, 7) ] )
## Time Series:
## Start = 1821
## End = 1827
## Frequency = 1
## [1] 269 321 585 NA NA NA 3928
On Mon, Jun 10, 2024 at 10:32?AM Martin Maechler
<maechler at stat.math.ethz.ch> wrote:
>
> >>>>> Spencer Graves
2004 Dec 12
1
Re: [R-sig-finance] dates and times on Windows for fMetrics
# Here is the solution:
require(fBasics)
# Be sure that R is running in time zone GMT.
# Set your Windows environment variable to "GMT"
# Your PC Windows clock can still run in any other time zone!
# My clock is now running in Zurich in Europe.
Date = c("2003-10-09", "2003-10-10", "2003-10-13", "2003-10-14")
Open = c(1.27, 1.25, 1.27,
2024 Jun 09
2
head.ts, tail.ts loses time
Hello, All:
The 'head' and 'tail' functions strip the time from a 'ts' object.
Example:
> head(presidents)
[1] NA 87 82 75 63 50
> window(presidents, 1945, 1946.25)
Qtr1 Qtr2 Qtr3 Qtr4
1945 NA 87 82 75
1946 63 50
Below please find code for 'head.ts' and 'tail.ts' that matches
'window'.
Comments?
2009 Jan 22
0
Confused about behavior of an S4 object containing a ts object
I posted the question below about a month ago but received no response.
I still have not been able to figure out what is happening.
I also noticed another oddity. When the data part of the object is a
multivariate time series, it doesn't show up in the structure, but it
can be treated as a multivariate time series. Is this a bug in str?
> setClass("tsExtended", representation =
2024 Jun 10
2
head.ts, tail.ts loses time
>>>>> Spencer Graves
>>>>> on Mon, 10 Jun 2024 07:50:13 -0500 writes:
> Hi, Gabor et al.: Thanks for this. I should change my
> current application to use either zoo or xts, as Gabor
> suggests.
> However, I was surprised to learn that "[.ts" does NOT
> return an object of class "ts". I see that
2005 Apr 22
0
fBasics question: Get dates corresponding to maximum values
fBasics question: Get maximum dates
Hello,
This two series data set has been created with the timeSeries() function
from fBasics
>str(total)
Formal class 'timeSeries' [package "fBasics"] with 7 slots
..@ Data : num [1:262, 1:2] 8703 8603 8573 8680 8668 ...
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:262] "2004-04-19 01:00:00"
2010 Apr 20
1
bug in aggregate.ts
Hi,
I am getting unexpected behaviour from aggregate.ts(). The 'ndeltat'
argument is effectively being reduced by 1 in some cases, even when it
is an integer, with the result that the blocks to be aggregated are
not of the expected size, and also that the end() of the aggregated
series is much later than the end() of the original series.
rawts <- ts(rep(1:10, each = 5), start = 1)
##
2006 Nov 23
1
Problem with as.ts(zoo-object)
Dear all,
I have an error message, when I try to convert a zoo object (called
test) to ts (on R 2.4.0, Package zoo version 1.2-1, Windows XP)
> test
1994-05-10 1994-06-09 1994-07-09
0.0024943889 0.0024881824 0.0006955831
> str(test)
atomic [1:3] 0.002494 0.002488 0.000696
- attr(*, "index")=Class 'Date' num [1:3] 8895 8925 8955
> is.regular(test)
[1] TRUE
2010 Apr 11
0
converting a ts object to an xts object
Dear R People:
This is probably is very simple question. I have a monthly time
series, ibm$ts , that I would like to convert to a quarterly series.
I know that I could use "aggregate", but I am interested in the
to.quarterly conversion, please.
Here is my example:
> str(ibm$ts)
Time-Series [1:144] from 1998 to 2010: 43.7 46.3 46 51.4 52.2 ...
> tsp(ibm$ts)
[1] 1998.000 2009.917
2019 Aug 03
0
[nbdkit PATCH 3/3] server: Add and use nbdkit_nanosleep
There are a couple of problems with filters trying to sleep. First,
when it is time to shut down nbdkit, we wait until all pending
transactions have had a chance to wind down. But consider what
happens if one or more of those pending transactions are blocked in a
sleep. POSIX says nanosleep is interrupted with EINTR if that thread
handles a signal, but wiring up signal masks just to ensure a
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