I'm trying out Quarto and 'converting' my Rmarkdown file into a quarto document. In my old Rmarkdown file, I would use source("R_datacleaning.R") and source("R_Functions.R") to run the data cleaning and to load some functions. I've also tried source(here("R_Functions.R")) but it doesn't work either. The R-scripts and the qmd files are in the same directory.
I can't seem to get that to work in the .qmd. The error I get is Error: RStudio not running. I've searched around and looked at the Quarto documentation, but couldn't find anything relating to this. I think there might be something I'm not understanding about the Quarto environment in RStudio. Would appreciate any help, thanks!
Edit:
---
title: "quarto_test2"
format: html
---
```{r}
library(here)
source(here("R_Functions.R"))
```
Error message is:
processing file: quarto_test2.qmd
|.......... | 14%
ordinary text without R code
|.................... | 29%
label: unnamed-chunk-1
Quitting from lines 7-10 (quarto_test2.qmd)
Error: RStudio not running
Execution halted
R_Functions.R is in the same directory as quarto_test2.qmd, as previously mentioned.
Version Info
2022.07.2.4.2.0.1.1.245.I was successful in pdf with
---
title: "source() external R script in Quarto, in PDF"
format:
pdf:
toc: true # table of contents
---
Some text...
```{r}
#| echo: true
#| eval: false # skip evaluation
#| file: C:/directory/script.R
```
Some text...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With