Set frequency in xts object
问题 I want to create an xts object in R, which I then want to decompose to seasonal and trend. > require(xts) > require(lubridate) > chicos$date <- ymd(chicos$date) > ctr.ts <- xts(chicos[, 7], order.by = chicos[, 8], frequency = 365) > plot(ctr.ts, main="Meaningful title") When I try to decompose it, I get this error message.. > plot(decompose(ctr.ts)) Error in decompose(ctr.ts) : time series has no or less than 2 periods My observations are daily, and span from 2014-12-01 to 2015-02-25. Did I