parent
e1e3e78b7c
commit
e2fcf4928d
|
@ -232,7 +232,7 @@ The caching system must be used with care, because by default it is based on the
|
|||
rawdata <- readr::read_csv("a_very_large_file.csv")
|
||||
`r chunk`
|
||||
|
||||
`r chunk`{r processed_data, cached = TRUE}
|
||||
`r chunk`{r processed_data, cache = TRUE}
|
||||
processed_data <- rawdata %>%
|
||||
filter(!is.na(import_var)) %>%
|
||||
mutate(new_variable = complicated_transformation(x, y, z))
|
||||
|
@ -240,7 +240,7 @@ The caching system must be used with care, because by default it is based on the
|
|||
|
||||
Caching the `processed_data` chunk means that it will get re-run if the dplyr pipeline is changed, but it won't get rerun if the `read_csv()` call changes. You can avoid that problem with the `dependson` chunk option:
|
||||
|
||||
`r chunk`{r processed_data, cached = TRUE, dependson = "raw_data"}
|
||||
`r chunk`{r processed_data, cache = TRUE, dependson = "raw_data"}
|
||||
processed_data <- rawdata %>%
|
||||
filter(!is.na(import_var)) %>%
|
||||
mutate(new_variable = complicated_transformation(x, y, z))
|
||||
|
|
Loading…
Reference in New Issue