I'm using VSCode for R programming. As I try different ways of plotting my data, I thought it might be a nice idea to use a Rmd file to get track of what I tried but my problem is I can't make this work.
I have rmarkdown
and knitr
installed but when I knit my .Rmd file, I get this output:
[VSC-R] 4.1_main.Rmd process started
==> rmarkdown::render('c:\\Users\\tl100\\Documents\\R\\thesis_figures\\4.1_main.Rmd')
Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).
Execution halted
[VSC-R] 4.1_main.Rmd process exited with exit code 1
[VSC-R] terminating R process
So I tried to install pandoc: installr::install.pandoc()
, but I get another error message:
> installr::install.pandoc()
trying URL 'https://github.com/'
downloaded 201 KB
The file was downloaded successfully into:
C:\Users\tl100\AppData\Local\Temp\RtmpwbBZMs/github.com
Running the installer now...
Die Version von C:\Users\tl100\AppData\Local\Temp\RtmpwbBZMs\github.com ist mit der ausgeführten Windows-Version nicht kompatibel. Überprüfen Sie die Systeminformationen des Computers, und wenden Sie sich anschließend an den Herausgeber der Software.
Installation status: FALSE . Removing the file:
C:\Users\tl100\AppData\Local\Temp\RtmpwbBZMs/github.com
(In the future, you may keep the file by setting keep_install_file=TRUE)
Warning message:
In shell(install_cmd, wait = wait, ...) :
'C:\Users\tl100\AppData\Local\Temp\RtmpwbBZMs/github.com' execution failed with error code 1
> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
However, I could successfully install pandoc via the msi installer from its github page (https://github.com/jgm/pandoc/releases/tag/3.1.9). Then, I check if pandoc is availalbe in my PATH variable:
But still, if I run rmarkdown::pandoc_available()
, it says FALSE
.
So is there a way of running Rmd files from VSCode, or do I have to use RStudio instead?
I would very much appreciate your help :-)