Skip to content

Allowing to set the seed for a whole knit() using a knitr option or a R option #2410

@cderv

Description

@cderv

This would allow for reproducibility of knitr::knit() in contexts where calling R code before knitr::knit() is not easy.

set.seed(123)
knit::knit()
set.seed(123)
knit::knit()

But in rmarkdown ran in background context or within quarto, this is not possible to do without modifying the document, or leveraging .Rprofile

Maybe having something like set.seed(knitr::opts_knit$get("set.seed")) would work, as it can also be set using env var and R options.

Related to question at:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions