type 'application/zip' length 1364950 bytes (1.3 MB) downloaded 1.3 MB package…
- User
type 'application/zip' length 1364950 bytes (1.3 MB) downloaded 1.3 MB
package ‘backports’ successfully unpacked and MD5 sums checked package ‘abind’ successfully unpacked and MD5 sums checked package ‘tensorA’ successfully unpacked and MD5 sums checked package ‘distributional’ successfully unpacked and MD5 sums checked package ‘ps’ successfully unpacked and MD5 sums checked package ‘checkmate’ successfully unpacked and MD5 sums checked package ‘matrixStats’ successfully unpacked and MD5 sums checked package ‘posterior’ successfully unpacked and MD5 sums checked package ‘callr’ successfully unpacked and MD5 sums checked package ‘processx’ successfully unpacked and MD5 sums checked package ‘inline’ successfully unpacked and MD5 sums checked package ‘gridExtra’ successfully unpacked and MD5 sums checked package ‘loo’ successfully unpacked and MD5 sums checked package ‘pkgbuild’ successfully unpacked and MD5 sums checked package ‘QuickJSR’ successfully unpacked and MD5 sums checked package ‘desc’ successfully unpacked and MD5 sums checked package ‘dygraphs’ successfully unpacked and MD5 sums checked package ‘extraDistr’ successfully unpacked and MD5 sums checked package ‘RcppParallel’ successfully unpacked and MD5 sums checked package ‘rstan’ successfully unpacked and MD5 sums checked package ‘rstantools’ successfully unpacked and MD5 sums checked package ‘StanHeaders’ successfully unpacked and MD5 sums checked package ‘BH’ successfully unpacked and MD5 sums checked package ‘RcppEigen’ successfully unpacked and MD5 sums checked package ‘prophet’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\katoj\AppData\Local\Temp\RtmpUJ58PB\downloaded_packages
Load Required Libraries
Load the required libraries:
library(prophet) Loading required package: Rcpp Loading required package: rlang
Prepare the Data
Aggregate the data by date to get the total confirmed cases for each date.
Preprocess the data:
time_series_data <- data %>%
-
code
group_by(date) %>% -
code
summarise(total_confirmed = sum(confirmed)) %>% -
code
ungroup()
Inspect the data
head(time_series_data)
A tibble: 1 × 2
date total_confirmed 1 NA 2978672
Prepare the Data for Prophet
Rename the columns to ds (date) and y (value) as required by Prophet:
prophet_data <- time_series_data %>%
-
- Assistant
- User
- Assistant