Skip to content

Commit

Permalink
inline group_by to pass R CMD CHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Oct 4, 2023
1 parent b5133a2 commit 1d63ca2
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions vignettes/modeltime-spark.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ Load the following libraries.
library(sparklyr)
library(modeltime)
library(timetk)
```

```r
library(tidymodels)
library(tidyverse)
```

```{r. echo = FALSE}
library(tidymodels)
library(dplyr)
```
Expand Down Expand Up @@ -96,16 +88,16 @@ The dataset we'll be forecasting is the `walmart_sales_weekly`, which we modify

```{r}
walmart_sales_weekly %>%
select(id, date = Date, value = Weekly_Sales) %>%
group_by(id) %>%
dplyr::select(id, date = Date, value = Weekly_Sales) %>%
dplyr::group_by(id) %>%
plot_time_series(date, value, .facet_ncol = 2, .interactive = FALSE)
```

We prepare as nested data using the Nested Forecasting preparation functions.

```{r}
nested_data_tbl <- walmart_sales_weekly %>%
select(id, date = Date, value = Weekly_Sales) %>%
dplyr::select(id, date = Date, value = Weekly_Sales) %>%
extend_timeseries(
.id_var = id,
.date_var = date,
Expand Down Expand Up @@ -200,7 +192,7 @@ Next, we can examine the test forecast for each of the models.
```{r}
nested_modeltime_tbl %>%
extract_nested_test_forecast() %>%
group_by(id) %>%
dplyr::group_by(id) %>%
plot_modeltime_forecast(.facet_ncol = 2, .interactive = F)
```

Expand Down

0 comments on commit 1d63ca2

Please sign in to comment.