Replies: 4 comments 4 replies
-
You are talking about the R package but the R package is a wrapper around the real tool which is not an R package contrary to knitr or RMarkdown (so it is not loaded in R session, does not use your R session or anything from it)
Quarto's document reproducibility is ensured by the fact that by the document itself or the Quarto project. For short, if you wanted to load R packages, render a Quarto document using the loaded functions, this can't be achieved. |
Beta Was this translation helpful? Give feedback.
-
ok thanks looks to me like a loss of feature compared to rmarkdown or knitr is there any plan for a knit2pdf that would compile from typst instead of Latex ? this would be great, and keep the facility to pick current R session as in regular knitr/rmarkdown |
Beta Was this translation helpful? Give feedback.
-
the workflow is the following quarto is oversized for that simple usage my workflow is more programmatic I would say, don't need the visual cells and don't use jupyter like approaches as they tend in my opinion to get in the way I don't aim at reproducibility with sharing to others with uploading in a cloud, I just need reproducibility for my own scripts of course currently you get typst with R sweave easely only in quarto, there is not knit2dpf using typst instead of latex... I know it's theoretically possible and relatively easy to tweak to do it with knitr, but I did'nt get to it yet when you put everything in a quarto cell you lose reusability of the scripts for other purpose, the scripts is trapped in the quarto document, ok for reproducibility, but not for reusablity of building block R scripts in my opinion there should be only minimal R instruction in a Rnw or quarto template, just the necessary to print the tables and the graphs namely, but not anything heavy to compute, and the rest is just writing thanks |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your feedback @blset ! Really appreciated to know more about users' workflow and how they try to use Quarto
As a developer of knitr and maintainer of R Markdown, I'll take the opportunity to comment on the workflow and compare it with Quarto. The workflow you have is very different from what Quarto offers. Quarto is closer to how the R Markdown workflow works. A document (respectively .qmd or .Rmd) is expected to contain all computations in cells. They are assumed to be reproducible source files. When preparations are in a bunch of R scripts, they can be loaded for the document in a cell at the top. There are features to easily load them:
So, regarding your comment
They are not trapped. You can do all your code content in an R script and then source it as a script to make computation available for knitr. To share experience, some even structure their work as an R package for their preparation function and data and load the package inside the document to make everything available easily, and have the package available for easy reusability outside the document. The document can then be rendered in a background session without problem. The assumption of having a Rmd file be reproducible by containing everything is the default, and it is even bigger with Quarto as rendering a .qmd will always run in a new clean R session. So, what to do when pre-calculation is needed, when data needs to be shared, or pre-computed ? So in a nutshell, yes, using Quarto will require a change in your workflow. It would have been the same if you were using R Markdown, probably. By using
I understand you are only considering Quarto for Typst support. So thank you for opening This is probably to be considered—PR is welcome there, too. We'll discuss it in the issue in the knitr repo.
For this part, I did not completely follow. To have a BTW, Quarto has support for So |
Beta Was this translation helpful? Give feedback.
-
Description
hello
using knit2pdf at the end of an R script the Rnw templates with latex inherit current session with all libraries loaded
I cannot translate that workflow with quarto
using quarto_render at the end of an R script the qmd files have no access to the current session
I would have to pass individually all objects and load all libraries and source scripts from inside the qmd files
this is very inconvenient
how would you pass the whole session to quarto simply ?
I'm aware the render button in rstudio executes everything in a brand new environment for reproducibility
but I thought using quarto_render would allow the use case of inheriting the current session which is very convenient when sharing is not the goal or to experiment easely
Beta Was this translation helpful? Give feedback.
All reactions