Prepend irregular xts with zeros?

Library(xts) Fist we need some sample data. Proda Xts(matrix(c(4,4), ncol = 1, dimnames = list(c("2009-05-02", "2010-02-03")))) prodb Data. Frame(val = apply(X = ab, MARGIN = 1, FUN = sum, na.

Rm = TRUE)) Result: val 2009-05-02 4 2010-02-03 8.

1 One point of clarification: merge. Xts merges on the index attribute, not row names (like merge.data. Frame).

– Joshua Ulrich Jun 10 at 14:04.

Here's a one-liner (using @Roman's example data): with(merge(proda,prodb,fill=0), proda+prodb) # proda # 2009-05-02 4 # 2010-02-03 8 merge. Xts has all=TRUE as a default and the fill= argument allows you to specify the values to be used for missing elements (default is fill=NA). The result of merge(proda,prodb,fill=0) is an object with two columns ("proda","prodb") and an index value for every index value in any of the objects passed to merge.xts.

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