2
votes

I can knit my .Rmd file to HTML and PDF but I can't run separate chunks that contain knitr::kable(). The problem is really strange since it's possible to create a PDF containing all the chunks but not run one of the chunks separately. When I try to run the chunk in question I get the error message below.

knitr::kable(df, digits = 6, caption = "Parameterskattningar för niter=1,2,3 och R's summary()")

Error message:

Error in system(command) : invalid input 'C:\PROGRA~1\RStudio\bin\pandoc\pandoc.exe +RTS -K512m -RTS "C:\Users\MAXSJD~1\AppData\Local\Temp\RtmpCKdLUS_rs_md_1ad85bc13dd1.md" --to html4 --output "C:\Users\Max Sjödin\AppData\Local\RStudio-Desktop\notebooks\878C31A-Lab 1 Stat inferens\1\s\csrh4amtwagyp_t_rs_html_1ad82c5879bb.html"' in 'utf8towcs'

2

2 Answers

1
votes

I think the problem is the ö character in the path to your RStudio project file. I had some issues when I create a script on an English Windows and then try to edit it on a Portuguese Windows version. I would love to see a more complete answer with a good explanation to why this happens, but this can maybe get things working for the time being.

0
votes

I got the same problem knitr::kable(). It occurred after I reinstalled the R to fresher version (3.5.2). The old one was 3.4.3.

What I did, just went back to the old one (may it sound stupid), and it worked.