carpentries / lesson-example

Example lesson using The Carpentries lesson template.
https://carpentries.github.io/lesson-example/
Other
64 stars 173 forks source link

Silent syntax error in Rmd example #341

Open unode opened 3 years ago

unode commented 3 years ago

There seems to be a silent error in the 05-rmarkdown-example.Rmd template included.

The error is also visible in the logs of GitHub Actions:

/home/runner/work/lesson-example/lesson-example/_episodes_rmd/05-rmarkdown-example.Rmd
--------------------------------------------------------------------------------------

ERROR 1: <text>:187:1: unexpected '>'
186: 
187: >
     ^

but looking at the file it's not clear to me what is wrong.

fmichonneau commented 3 years ago

I believe it's a bug with renv that doesn't recognize properly code blocks prefixed with > as found in exercises and solutions.

fmichonneau commented 3 years ago

@maxim-belkin's pull request removes the warning. However, using renv.ignore = TRUE leads renv to ignore the chunk when looking for dependencies. In this case, it's fine because the only function used in the chunk belongs to base R but in other contexts this approach could lead to dependencies not being recognized.