1

I have an index.qmd page in quarto that loads a dataset

```{r}
test <- TRUE
source(paste0(getwd(),"/loading.R"))
```

I have another page page1.qmd that needs to use the datasets loaded by the index page

```{r}
print(check)
print(test)
```

the loading.R file contains code to create check

check <- TRUE

Rendering using quarto render gives the following error:

←[1m←[34m[ 1/20] about.qmd←[39m←[22m
←[1m←[34m[ 2/20] page1.qmd←[39m←[22m
?[31m

processing file: page1.rmarkdown
  |...................................                                   |  50%
label: unnamed-chunk-1
?[31mQuitting from lines 2-7 (page1.rmarkdown)
?[39m?[31mError in print(check) : object 'check' not found

It seems that the source load doesn't put things into global memory. How can I go about doing this?

pluke
  • 3,832
  • 5
  • 45
  • 68
  • 1
    [This answer](https://stackoverflow.com/a/73536041/10858321) may be of help and also you may look into [this](https://stackoverflow.com/a/73638836/10858321). – shafee Jan 10 '23 at 18:11

0 Answers0