"You can't use macro parameter character # in vertical mode"

I've finished a project for university and the only step left is to compute a pdf document with my r script. At an earlier time I used knitr (stitch('myproject.R') to do this, which worked just fine, however at this point, R Studio will only give out a .tex document. I think this is due to the error "You can't use macro parameter character # in vertical mode" which I'm getting all over. I don't know what this means and how to fix it.

Any help is much appreciated! Note that my r skills are very very basic and my Latex skills non-existent.

Thank you!

Maybe knitr::spin() wil be better suited if you want to generate a report from an R script ?

knitr::stitch() allows to convert an R script to a template for other rendering and default is a TeX file, hence the result you get I believe See stitch: Automatically create a report based on an R script and a... in knitr: A General-Purpose Package for Dynamic Report Generation in R

If you want directly a PDF report from you R script without a Rmd file or TeX file, then knitr::spin() seems a better tool.

Hope it helps

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.