I have an xts object, for example
ts=xts(seq(10),seq(Sys.Date(),Sys.Date()+10,length.out=10))
and need to add a new point, for example
(Sys.Date()+11, 11)
I have tried
ts[Sys.Date()+11] <- 11
but it doesnt work. I would prefer to avoid creating a new xts object. Is there an elegant way to do this.
You can use
corrbindon anxtsobject to append row-wise:EDIT :
Note that this produces a warning
mismatched types: converting objects to numeric. To remove the warning, first coerce the value to numeric, e.g: