Setting an xts Index?

Direct answer to the post is that the magic is inside of attr as Josh says. Subsetting the object first simply creates a new object that gets promptly disposed of once time.

Direct answer to the post is that the magic is inside of attrEssentially an vector of type double or integer that maps to POSIXct time - with some attributes attached. The class you are assigning is automatically coerced back and forth. This makes the internals easier to maintain - and lets you do things with any time class you need outside of it.In general, Date will be the cleanest way to keep TZ and secs trouble out of the mix, but keep in mind that the cost of this hidden aspect is the function index().

This will have to recreate the object you expect.

Welcome to stackoverflow, Jeff! – Shane Jan 28 at 23:45.

The dates in time series are not referenced with "". They are more like rownames in dataframes. They are stored in the "index" leaf of the attributes list.In addition to that, they are not of Date class but rather the DateTime class so you need to may use POSIXct: > attributes(junk)$index1 junk ,1 2010-02-01 1 2010-05-01 2 Edit: more accurately the attribute$index is internally in seconds but the time method will accept a variety of assignment classes.

I'll remember that attributes function. I'm still working on that methods("timeMost of my time data will be daily or monthly data (minute and second requirements are rare, but possible). – Bill S Dec 14 '10 at 18:59 In this case it is not needed, since there is a time– DWin Dec 15 '10 at 17:45.

2 Except there is a time– DWin Dec 14 '10 at 3:13 @Dwin good catch. I was looking at time, not time– Joshua Ulrich Dec 14 '10 at 11:13 That makes sense. Also, in the time(junk)1 statement (the last chunk of code), is a new subset object created that references junk?

And, that reference forces junk to be modified? – Bill S Dec 14 '10 at 18:52 @Bill time(junk) returns the index attribute of junk; and I'm not familiar enough with R's parse/eval rules on object attributes to be able to tell you for sure what attr.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions