Skip to content
Prev 285488 / 398503 Next

Converting ts into xts and subsetting

Thank you for your replies. That can be quite tricky indeed.

The data consists of monthly unemployment rates, which I get as a text 
file along with the information: monthly, period of beginning and end. 
So it does not come with some timestamp as I specify the time inside R.

This tweak time(X2) <- time(X2) + 6*60*60 does not work. However this 
solves the problem:
     time(X2)=as.POSIXct(time(X2))+6*60*60

But then each element in my series now show up with time too instead of 
only year/month alone.

However Sys.setenv(TZ = "GMT") works perfectly for this purpose.

Thank you for your insights!