我是新手,R
我遇到了一个问题。我已经使用Prophet
包来预测值,但由于我不明白的模糊原因它不起作用。
这是我的代码:
install.packages("tidyverse")
install.packages("prophet")
library(dplyr)
library(prophet)
data2 <- read.csv("Eyeballs daily 2015 - 2016 - Sheet1.csv")
data2$daily <- as.Date(data2$daily)
december <-data_frame (
holiday='december',
ds=as.Date(c('2012-12-22','2013-12-21','2014-12-20','2015-12-09','2016-
12-17','2017-12-23','2018-12-22','2019-12-21','2020-12-19')),
lower_window=0,
upper_window=14
)
februarya <-data_frame (
holiday='februarya',
ds=as.Date(c('2013-02-23','2014-03-01','2015-02-07','2016-01-13','2017-
02-18','2018-02-10','2019-02-16','2020-02-15','2021-02-06')),
lower_window=0,
upper_window=14
)
februaryb <- data_frame (
holiday='februaryb',
ds=as.Date(c('2013-02-16','2014-02-22','2015-02-21','2016-02-06','2017-
02-11','2019-02-09','2020-02-08','2021-02-20')),
lower_window=0,
upper_window=14
)
februaryc <- data_frame (
holiday='februaryc',
ds=as.Date(c('2013-03-02','2014-02-15','2015-02-14','2016-02-20','2017-
02-04','2018-02-17','2019-02-23','2020-02-01','2021-02-13')),
lower_window=0,
upper_window=14
)
holidays <- bind_rows(december,februarya,februaryb,februaryc)
m <- prophet (data2, holidays = holidays)
future <- make_future_dataframe(m, periods = 120, freq = "day")
forecast <- predict (m, future)
write.csv(forecast , "test.csv")
一切都在工作,直到这行代码
m <- prophet (data2, holidays = holidays)
错误如下:
Error in filter_impl(.data, quo) :
Evaluation error: object 'y' not found.
有人知道为什么吗?
先感谢您