is contiguous by definition there. Also, compatibility problems
may not be a big concern for these functions.
Georgi Boshnakov
Date: Tue, 11 Jun 2024 09:13:49 -0400
From: Gabor Grothendieck
To: Martin Maechler
Cc: Spencer Graves , r-devel
Subject: Re: [Rd] head.ts, tail.ts loses time
Mes
> Spencer Graves
> on Mon, 10 Jun 2024 09:45:46 -0500 writes:
> 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
> Gabor Grothendieck
> on Tue, 11 Jun 2024 09:13:49 -0400 writes:
> 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
> ## Fre
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
wro
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
> 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 obj
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 re
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
wrote:
>
> Hello, All:
>
>
> The 'head' and
It looks like to me the class is being removed explicitly due to the use of
as.numeric()
On Sun, Jun 9, 2024 at 12:04 PM Spencer Graves
wrote:
> Hello, All:
>
>
> The 'head' and 'tail' functions strip the time from a 'ts'
> object.
> Example:
>
>
> > head(presidents)
> [1] NA 87 82 75
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' t
10 matches
Mail list logo