I am trying to write a learnr
tutorial in which one of the exercises is to import an SPSS dataset. From the learnr
documentation:
There are three ways authors can include files for use in exercises:
Store the files in a data/ directory in the same directory as the
tutorial.Use the setup chunk to download or write the files to a data/
directory.Use the tutorial.data_dir global option or the TUTORIAL_DATA_DIR
environment variables to specify a path to a data directory.
Following method #1 above, I have created a "data" directory within the directory that contains my .rmd file:
> list.files()
[1] "data" "filemgmt.html" "filemgmt.Rmd"
>
And the directory contains a file named "frm_wide.sav":
> list.files(path="./data", pattern="frm_wide.sav")
[1] "frm_wide.sav"
>
Now, when I run the filemgmt.Rmd
, I get an error because the file is not found:
What I am doing wrong?