Skip to content
Back to formatted view

Raw Message

Message-ID: <AANLkTikYh1iFRCBAeDyUoAhO+ETP3KOrFBuzpSH8q1fX@mail.gmail.com>
Date: 2010-12-10T21:31:32Z
From: Gabor Grothendieck
Subject: Time Series Row Label
In-Reply-To: <1292012183267-3082639.post@n4.nabble.com>

On Fri, Dec 10, 2010 at 3:16 PM, dreadgazebo <ernie.tedeschi at gmail.com> wrote:
>
> Simple question...
>
> I know that when referencing data in a multivariate time series matrix, I
> can use the variable name instead of the column number (such as
> budget.ts[4,"incometax"]). Is there a way I can use the time unit (say, the
> year in an annual time series) instead of the row number?

You can use window(), e.g.

tt <- ts(1:4, start = 2000)
window(tt, start = 2001, end = 2002)

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com