Skip to content
Prev 371387 / 398506 Next

require help

You can just use the same code that I provided before but now use your
dataset. Like this

df <- read.csv(file="data2.csv",header=TRUE)
dates <- as.Date(paste(df$year,"-01-01",sep=""))
myXts <- xts(df,order.by=dates)
head(myXts)

#The last command "head(myXts)" shows you the first few rows of the xts
object
           year     cnsm    incm    wlth
1980-01-01 1980 173.6527 53.3635 60.3013
1981-01-01 1981 175.4613 53.6929 60.4980
1982-01-01 1982 174.5724 53.4890 60.2358
1983-01-01 1983 171.5070 53.2223 60.1047
1984-01-01 1984 173.3462 53.2851 60.6946
1985-01-01 1985 171.7075 53.1596 60.7598
On Sat, Sep 16, 2017 at 9:55 AM, Berend Hasselman <bhh at xs4all.nl> wrote: