UMCarpentries / intro-curriculum-r

Custom curriculum for teaching R, the Unix Shell, & Git with an integrated workflow and reproducible research practices.

Home Page:https://umcarpentries.org/intro-curriculum-r/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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...

  1. Put the ../ before the path, pointing out that rmarkdown is looking for data/ within reports/ rather than within the root of the proect
  2. Use the here package
  3. 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.