Skip to content
Back to formatted view

Raw Message

Message-ID: <3A6794D5-0D6E-4CE7-9798-DB34B66DD0B2@xs4all.nl>
Date: 2017-09-15T16:26:52Z
From: Berend Hasselman
Subject: require help
In-Reply-To: <0249DE6B-4A43-463D-BD74-485239771CCC@xs4all.nl>

> On 15 Sep 2017, at 16:35, Berend Hasselman <bhh at xs4all.nl> wrote:
> 
>> 
>> On 15 Sep 2017, at 11:38, yadav neog <yadavneog at gmail.com> wrote:
>> 
>> hello to all. I am working on macroeconomic data series of India, which in
>> a yearly basis. I am unable to convert my data frame into time series.
>> kindly help me.
>> also using zoo and xts packages. but they take only monthly observations.
>> 
>> 'data.frame': 30 obs. of  4 variables:
>> $ year: int  1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 ...
>> $ cnsm: num  174 175 175 172 173 ...
>> $ incm: num  53.4 53.7 53.5 53.2 53.3 ...
> 
> 
> It shouldn't be difficult.
> Example:
> 
> tsdata <- data.frame(year=c(2000,2002,2003), x=c(1,2,3),y=c(10,11,12))
> xy.ts <- as.ts(tsdata)
> 
> library(zoo)
> 
> as.zoo(xy.ts)


Ignore my suggestion.  Doesn't do what you need.

Berend