I have made a package with some learnr
tutorials, available at https://github.com/Bio302-UiB/data-handling
The tutorials all work before I build the package, but afterwards one of the tutorials fails when run with learnr::run_tutorial(). It also fails when run from the tutorials tab.
remotes::install_github("Bio302-UiB/data-handling")
> learnr::run_tutorial("text-manipulation", package = "data.handling")
processing file: text-manipulation.Rmd
...
|................................ | 66%
label: replace-tibble
Quitting from lines 284-288 (text-manipulation.Rmd)
Error: Problem with `mutate()` input `species`.
x unused argument (string = species)
ℹ Input `species` is `str_replace(string = species, pattern = "_", replacement = " ")`.
The chunk that is failing for learnr is
{r replace-tibble}
diatom_df %>%
mutate(species = str_replace(string = species,
pattern = "_",
replacement = " "))
The same tutorial works fine if I open the file from the package and use the blue knit button
usethis::edit_file(system.file("tutorials/text-manipulation/text-manipulation.Rmd", package = "data.handling"))
(Thereafter run_tutorial works, but is presumably using the pre-rendered html)
I don't even know how to start to debug this problem. Any suggestions?