Paths in writing reports
pschloss opened this issue · comments
This seems to touch on topics raised in #74, but I'm wondering how best to teach the issues with the path to data/gapminder_1997.csv
. What we call the default Rmd file is not correct - I just looked again and the default Rmd file doesn't have
knitr::opts_knit$set(root.dir = normalizePath("..")
I'm not sure I really want to have the learners type this in since there's a lot going on there that will be pretty advanced. I could see three different options for presenting this concept...
- Put the
../
before the path, pointing out thatrmarkdown
is looking fordata/
withinreports/
rather than within the root of the proect - Use the
here
package - Use the
normalizePath
syntax as written in the teaching materials
My preference would be for 2 since I use 2 in my work. The downside is that it's another package to install, albeit with pretty simple syntax. But I think 1 would be fine in this context where there's only a few paths that would need the ../
I'm a fan of the here
package. I think it wouldn't be too much extra overhead to teach briefly.