Skip to content

Commit

Permalink
Updated A2 to avoid missing data
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Mar 15, 2024
1 parent 921e175 commit 26c170b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions assignments/A2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ This assignment will use the same data that you will use in the [retail project]

```r
library(fpp3)
# Replace the seed with your student ID
set.seed(12345678)
retail <- readr::read_rds("https://bit.ly/monashretaildata") |>
filter(`Series ID` == sample(`Series ID`, 1))
get_my_data <- function(student_id) {
set.seed(student_id)
all_data <- fill_gaps(readr::read_rds("https://bit.ly/monashretaildata"))
while(TRUE) {
retail <- filter(all_data, `Series ID` == sample(`Series ID`, 1))
if(!any(is.na(retail$Turnover))) return(retail)
}
}
# Replace the argument with your student ID
retail <- get_my_data(12345678)
```

1. Plot your time series using the `autoplot()` command. What do you learn from the plot?
Expand Down

0 comments on commit 26c170b

Please sign in to comment.