I have an XTS time series object which shows a value on the first of each month (representing an aggregated sum for the whole month) during four years.
When I run the stats::acf()
function on it, I get a plot with lag (x axis) units in the hundreds of thousands. How can that be if I only have 48 values in my time series? If it is a time unit, then which one, and how can I change it?
Example code:
library(dplyr)
library(lubridate)
library(xts)
set.seed(100)
test <- data.frame(y = c(rep(2012, 12), rep(2013, 12), rep(2014, 12), rep(2015, 12)),
m = rep(seq(1, 12, 1), 4), d = rep(1, 48), value = runif(48, 0, 100))
test <- test %>%
mutate(date = ymd(paste(y, m, d, sep = "-"))) %>%
select(date, value)
test <- xts(test$value, test$date)
acf(test)