Hey, I have this data set of 78 different locations where I have to predict the price of a single product for the next 3 months. The data has daily entries for about 6 months (April - October). But, when I run the model it gives me this error. Please help me to resolve this error.
Error: object of type 'closure' is not subsettable
My code:
Area_forecast <- data1 %>%
filter(product == "garri") %>%
select( level2code, ds, y = pred) %>%
mutate(ds = paste(ds, "01", "01", sep = "-") %>% as.Date()) %>%
group_by(level2code) %>%
do(model = prophet(.),
Predicted_values = make_future_dataframe(model,92),
results = predict(model, Predicted_values))
Disabling yearly seasonality. Run prophet with yearly.seasonality=TRUE to override this.
Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.
Sample data set:
ds | product | level2code | pred |
---|---|---|---|
2021-04-01 | garri | NG020001 | 366.1540473 |
2021-04-01 | garri | NG020002 | 393.3557317 |
2021-04-01 | garri | NG020003 | 374.3132972 |
2021-04-01 | garri | NG021001 | 353.1266783 |
2021-04-01 | garri | NG021002 | 329.9673004 |
2021-04-01 | garri | NG021003 | 391.1370065 |
2021-04-01 | garri | NG021004 | 306.1356683 |
2021-04-01 | garri | NG020004 | 372.8115048 |
2021-04-01 | garri | NG020005 | 350.0100309 |
2021-04-01 | garri | NG021005 | 373.0025842 |
2021-04-01 | garri | NG020006 | 383.1839042 |
2021-04-01 | garri | NG021006 | 383.5212653 |
2021-04-01 | garri | NG020007 | 486.8226379 |
2021-04-01 | garri | NG020008 | 334.8151487 |
2021-04-01 | garri | NG021007 | 379.89125 |
2021-04-01 | garri | NG021008 | 370.9376296 |
2021-04-01 | garri | NG021009 | 389.4640031 |
2021-04-01 | garri | NG021010 | 365.9266992 |
2021-04-01 | garri | NG020009 | 380.4655716 |
2021-04-01 | garri | NG020010 | 352.6139069 |
2021-04-01 | garri | NG020011 | 243.5701952 |
2021-04-01 | garri | NG021011 | 366.6883205 |
2021-04-01 | garri | NG021012 | 326.9402671 |
2021-04-01 | garri | NG020012 | 403.5666062 |
2021-04-01 | garri | NG021013 | 405.2860516 |
2021-04-01 | garri | NG021014 | 348.023662 |
2021-04-01 | garri | NG020013 | 372.7586167 |
2021-04-01 | garri | NG020014 | 392.5432373 |
2021-04-01 | garri | NG020015 | 362.1098193 |
2021-04-01 | garri | NG020016 | 343.9205353 |
2021-04-01 | garri | NG020017 | 366.5290601 |
2021-04-01 | garri | NG020018 | 431.0832709 |
2021-04-01 | garri | NG020019 | 411.3581413 |
2021-04-01 | garri | NG021015 | 348.3274897 |
2021-04-01 | garri | NG021016 | 336.3743799 |
2021-04-01 | garri | NG020020 | 393.8901327 |
2021-04-01 | garri | NG021017 | 391.7393648 |
2021-04-01 | garri | NG021018 | 346.0988762 |
2021-04-01 | garri | NG021019 | 346.1310667 |
2021-04-01 | garri | NG021020 | 359.2837766 |
2021-04-01 | garri | NG020021 | 450.4413674 |
2021-04-01 | garri | NG020022 | 373.6406838 |
2021-04-01 | garri | NG021021 | 420.0838824 |
2021-04-01 | garri | NG020023 | 408.6912783 |
2021-04-01 | garri | NG020024 | 285.8249281 |
2021-04-01 | garri | NG020025 | 388.3307999 |
2021-04-01 | garri | NG020026 | 365.1686898 |
2021-04-01 | garri | NG020027 | 391.6867595 |
2021-04-01 | garri | NG021022 | 384.1850593 |
2021-04-01 | garri | NG021023 | 397.7172044 |
2021-04-01 | garri | NG020028 | 331.2182171 |
2021-04-01 | garri | NG021024 | 393.323333 |
2021-04-01 | garri | NG020029 | 405.5813127 |
2021-04-01 | garri | NG021025 | 359.658715 |
2021-04-01 | garri | NG021026 | 370.3166839 |
2021-04-01 | garri | NG021027 | 391.088788 |
2021-04-01 | garri | NG021028 | 364.2770249 |
2021-04-01 | garri | NG020030 | 375.2600611 |
2021-04-01 | garri | NG021029 | 358.9618615 |
2021-04-01 | garri | NG020031 | 439.1322423 |
2021-04-01 | garri | NG020032 | 402.7340519 |
2021-04-01 | garri | NG021030 | 345.2253201 |
2021-04-01 | garri | NG020033 | 356.2798309 |
2021-04-01 | garri | NG020034 | 369.3260162 |
2021-04-01 | garri | NG021031 | 368.6820545 |
2021-04-01 | garri | NG021032 | 342.8985896 |
2021-04-01 | garri | NG021033 | 388.3937476 |
2021-04-01 | garri | NG020035 | 369.5370586 |
2021-04-01 | garri | NG020036 | 374.2149029 |
2021-04-01 | garri | NG020037 | 374.3105323 |
2021-04-01 | garri | NG020038 | 419.9881972 |
2021-04-01 | garri | NG020039 | 356.6891081 |
2021-04-01 | garri | NG020040 | 385.9381759 |
2021-04-01 | garri | NG020041 | 308.1801669 |
2021-04-01 | garri | NG020042 | 383.1544687 |
2021-04-01 | garri | NG020043 | 381.4891835 |
2021-04-01 | garri | NG020044 | 362.6149694 |
2021-04-01 | garri | NG021034 | 351.0315915 |
2021-04-02 | garri | NG020001 | 347.5080909 |
2021-04-02 | garri | NG020002 | 417.7950263 |
2021-04-02 | garri | NG020003 | 357.6293544 |
2021-04-02 | garri | NG021001 | 364.0809209 |
2021-04-02 | garri | NG021002 | 350.5885553 |
2021-04-02 | garri | NG021003 | 412.9410955 |
2021-04-02 | garri | NG021004 | 326.3732426 |
2021-04-02 | garri | NG020004 | 374.9451842 |
2021-04-02 | garri | NG020005 | 335.0886535 |
2021-04-02 | garri | NG021005 | 365.002555 |
2021-04-02 | garri | NG020006 | 392.6334097 |
2021-04-02 | garri | NG021006 | 379.2592638 |
2021-04-02 | garri | NG020007 | 438.0161714 |
2021-04-02 | garri | NG020008 | 361.915949 |
2021-04-02 | garri | NG021007 | 357.060549 |
2021-04-02 | garri | NG021008 | 382.9647718 |
2021-04-02 | garri | NG021009 | 389.1019382 |
2021-04-02 | garri | NG021010 | 333.3285699 |
2021-04-02 | garri | NG020009 | 406.0860302 |
2021-04-02 | garri | NG020010 | 342.7835896 |
2021-04-02 | garri | NG020011 | 243.602651 |
2021-04-02 | garri | NG021011 | 358.4753587 |
2021-04-02 | garri | NG021012 | 333.9547987 |
2021-04-02 | garri | NG020012 | 424.8915992 |
2021-04-02 | garri | NG021013 | 407.2047254 |
2021-04-02 | garri | NG021014 | 356.6045034 |
2021-04-02 | garri | NG020013 | 358.297996 |
2021-04-02 | garri | NG020014 | 432.0024885 |
2021-04-02 | garri | NG020015 | 363.1590239 |
2021-04-02 | garri | NG020016 | 334.1112816 |
2021-04-02 | garri | NG020017 | 376.0309518 |
2021-04-02 | garri | NG020018 | 426.4144669 |
2021-04-02 | garri | NG020019 | 400.1660285 |
2021-04-02 | garri | NG021015 | 337.3337231 |
2021-04-02 | garri | NG021016 | 341.8770212 |
2021-04-02 | garri | NG020020 | 391.1870559 |
2021-04-02 | garri | NG021017 | 397.611482 |
2021-04-02 | garri | NG021018 | 345.1756482 |
2021-04-02 | garri | NG021019 | 346.5591129 |
2021-04-02 | garri | NG021020 | 347.5115345 |
2021-04-02 | garri | NG020021 | 435.024338 |
2021-04-02 | garri | NG020022 | 382.7996258 |
2021-04-02 | garri | NG021021 | 388.406993 |
2021-04-02 | garri | NG020023 | 417.0865963 |
2021-04-02 | garri | NG020024 | 293.7273414 |
2021-04-02 | garri | NG020025 | 408.075575 |
2021-04-02 | garri | NG020026 | 360.3596338 |
2021-04-02 | garri | NG020027 | 398.2523865 |
2021-04-02 | garri | NG021022 | 395.1357617 |
2021-04-02 | garri | NG021023 | 387.7742073 |
2021-04-02 | garri | NG020028 | 341.8796137 |
2021-04-02 | garri | NG021024 | 383.3824892 |
2021-04-02 | garri | NG020029 | 415.2975719 |
2021-04-02 | garri | NG021025 | 367.5180956 |
2021-04-02 | garri | NG021026 | 373.8995221 |
2021-04-02 | garri | NG021027 | 390.6734957 |
2021-04-02 | garri | NG021028 | 348.9460594 |
2021-04-02 | garri | NG020030 | 397.2809552 |
2021-04-02 | garri | NG021029 | 352.6791518 |
2021-04-02 | garri | NG020031 | 431.4367737 |
2021-04-02 | garri | NG020032 | 394.5424715 |
2021-04-02 | garri | NG021030 | 388.4691285 |
2021-04-02 | garri | NG020033 | 350.0768082 |
2021-04-02 | garri | NG020034 | 370.2760778 |
2021-04-02 | garri | NG021031 | 365.5463449 |
2021-04-02 | garri | NG021032 | 353.6569909 |
2021-04-02 | garri | NG021033 | 347.2475542 |
2021-04-02 | garri | NG020035 | 371.0247191 |
2021-04-02 | garri | NG020036 | 380.1494315 |
2021-04-02 | garri | NG020037 | 395.302709 |
2021-04-02 | garri | NG020038 | 433.3253765 |
2021-04-02 | garri | NG020039 | 350.8312732 |
2021-04-02 | garri | NG020040 | 382.1718306 |
2021-04-02 | garri | NG020041 | 316.6798756 |
2021-04-02 | garri | NG020042 | 409.7501652 |
2021-04-02 | garri | NG020043 | 385.8142597 |
2021-04-02 | garri | NG020044 | 379.9411943 |
2021-04-02 | garri | NG021034 | 345.6267946 |