lesson-example icon indicating copy to clipboard operation
lesson-example copied to clipboard

Silent syntax error in Rmd example

Open unode opened this issue 4 years ago • 2 comments

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.

unode avatar Apr 28 '21 11:04 unode

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

fmichonneau avatar Apr 28 '21 13:04 fmichonneau

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

fmichonneau avatar Oct 13 '21 05:10 fmichonneau