[R] window?
R. Michael Weylandt
michael.weylandt at gmail.com
Tue Nov 8 21:28:07 CET 2011
I'm not entirely sure that your request makes sense: what do you
expect the frequency to be? It makes sense to me as is...Might your
troubles be because 53 is prime?
More generally, most people don't like working with the raw ts class
and prefer the zoo or xts packages because they are much more pleasant
for most time series work. You might want to take a look into those.
Michael
On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton <rkevinburton at charter.net> wrote:
> This doesn't seem to work:
>
>
>
>> d <- rnorm(2*53)
>
>> ds <- ts(d, frequency=53, start=c(2000,10))
>
>> dswin <- window(ds, start=c(2001,1), end=c(2001,10), frequency=1)
>
>> dswin
>
> Time Series:
>
> Start = 2001
>
> End = 2001
>
> Frequency = 1
>
> [1] 1.779409
>
>
>
>> dswin <- window(ds, start=c(2001,1), end=c(2001,10))
>
>> dswin
>
> Time Series:
>
> Start = c(2001, 1)
>
> End = c(2001, 10)
>
> Frequency = 53
>
> [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959
>
> [7] -0.0183454 -1.0026301 0.4534920 0.6058198
>
>>
>
>
>
> The problem is that when the frequency is specified only one value shows up
> in the window. When no frequency is specified I get all 10 values but now
> the time series has a frequency that I don't want.
>
>
>
> Comments?
>
>
>
> Kevin
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list