-
-
Notifications
You must be signed in to change notification settings - Fork 995
Description
Dear @yihui and colleagues, this is a rather technical question (see link to RStudio community at the end)
Within a package I am working on, I am creating optional vignettes that the user can build on demand.
I would like the building of such vignettes happens in an environment that does not have the global one as parent.
So, my custom vignette building function includes something like:
vignette_env <- new.env(parent = baseenv())
rmarkdown::render(path.to.file, envir = vignette_env)The problem, when I do that, is that the package loaded and the objects created inside knitr chunks are not visible (in scope) to inline calls that follow, although they are visible to other chunks.
I don't understand why and how to cope with this scoping issue.
I have posted a question on RStudio community with a full reprex (https://community.rstudio.com/t/scoping-environment-struggle-in-r-markdown/70709), but failed to attract any attention in more than a week.