-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Sharing R environment between book chapters #1590
Comments
bookdown defaults to a Merge and Knit approach where all the document are merged before knitting. Other approach Knit and Merge when Quarto works in a way similar to the latter where document each run R code in a separate session. See discussion about this in other discussion like #1045 and linked ones. For now, you would need to use some explicit caching and object saving + reloading if you want to share data across R sessions in several files. Regarding parameters, it is supported in Quarto and should be working in Book format also (https://quarto.org/docs/computations/parameters.html). But what you mean is that the parameter is not accessible in other document right ? It is possible that we need to add support for parameters defined in |
issue #1712 would solve if the needed shared environments were in adjacent chapters, so like chapter 8 and chapter 9. You could put the chapters in one qmd file. |
Thanks. An environment option when rendering would be useful. Regarding parameters in a book, yes. I mean the same as with environment variables. I can define within one chapter but they are not passed on. I would like to be able to define parameters centrally and have all chapters be able to access them. |
Is this currently possible? Can I pass |
Having this available from |
For reference the params topic is related to |
Hi, has there been any development on having parameters passed from the _quarto.yml file? Alternatively, can anyone suggest a workaround for my situation? I'm trying to make a book with a dynamic title and footer based on runtime-defined parameters (i.e., using execute_params command when rendering), but it doesn't render with the parameters passed through that command. It will only render with the "blank" parameters that I pre-define at the beginning of the index.qmd file (that I assume would've been replaced by the runtime parameter values). |
@jonpeake The issue is still open and the milestone is set to Future meaning, it is planned but not in a short term timeframe. Since this is an issue and are asking for something in particular, I suggest you open a discussion and share a concrete small example of your setup, alongside a clear explanation of what your goal is and what you want to achieve. |
Thank you for the update, I appreciate it. I'll go ahead and set up a discussion post in the meantime. |
I'm playing with Quarto Books for the first time having been a R/bookdown user for a while. I have a simple book with two chapters. In the first chapter I define a variable ,
x
, and I want to then usex
in my second chapter. In bookdown this works fine. But with Quarto I get, "Error in eval(expr, envir, enclos) : object 'x' not found" when I click render in RStudio. I'm very willing to accept user error, or that independence of chapters is a design choice. But it wasn't something I was expecting.I've attached a worked example.
What I'm actually more interesting in working out is how to pass params (from a YAML header) from chapter to chapter. Previously I could include something like this in the index file:
and then access it in all other chapters
test_params_quorto.zip
.
The text was updated successfully, but these errors were encountered: