schmettow / PfP_Book

Programming for Psychologists - a primer
0 stars 1 forks source link

Errors when trying to knit #3

Closed lenabrandl closed 6 years ago

lenabrandl commented 6 years ago

@schmettow I can no longer knit the .Rmd chapter files. Whenever I try to knit a chapter, all code chunks are executed, including the ones I marked with eval=FALSE. I frequently include errorneous Python code on purpose to emphasize explanations or as part of exercises.

Do you have any idea why knitting including errorneous code chunks worked before, but doesn't anymore?

schmettow commented 6 years ago

I cannot reproduce your problem. However, if the code is syntactically invalid, it is the parser that throws error messages. All code in chunks is parsed in order to get syntax highlighting. In such a case, use a chunk with the engine left blank:

```{}
lenabrandl commented 6 years ago

I can confirm that the parser is the culprit behind the error messages. I will use blank code chunks for syntactical invalid code in the future!