You can use c
or rbind
for the rbind
object to add a line in different ways:
c(ts, xts(11, Sys.Date()+11))
EDIT:
Note that this raises the warning mismatched types: converting objects to numeric
. To remove a warning, first force the value into a numeric value, for example:
c(ts, xts(as.integer(11), Sys.Date()+11)) [,1] 2011-12-01 1 2011-12-02 2 2011-12-03 3 2011-12-04 4 2011-12-05 5 2011-12-06 6 2011-12-07 7 2011-12-08 8 2011-12-09 9 2011-12-11 10 2011-12-12 11
source share