Skip to content

function to easily add a preamble in R file for script rendering Β #164

@cderv

Description

@cderv

Rendering R script is possible in 1.4 now, but quarto does require a YAML preamble for it to be considered a script to be rendered

https://quarto.org/docs/computations/render-scripts.html#knitr

We could add a simple function in this package to easily add it, and default the title to be the name of the file (same default as spinning)

quarto::add_spin_preamble("script.R")

would add

#' ---
#' title: script.R
#' ---

at the very top of the file

This would allow to easily batch process folder of file using a looping function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions