toolero 0.4.0
New features
- Added
run_by_group(), the apply half of the split-apply workflow. Accepts either a manifest CSV produced bywrite_by_group(manifest = TRUE)or a named list of data frames. Applies a user-supplied function to each group subset and collects the results into a flat tibble (when the function returns a data frame) or a nested tibble with a list-column (when it returns anything else). Supports parallel execution viafurrrandfuturethrough theworkersargument, with a ceiling atmax(1L, parallelly::availableCores() - 1L)to reserve one core for the main session. Aseedargument enables reproducible parallel execution for analyses involving randomness. - Added
read_clean_csv()for reading CSV files into a tibble withjanitor::clean_names()applied automatically. Supports explicit missing-value codes viana, selective row dropping viadrop_na(acceptsTRUEor a character vector of column names), an optional ingest summary viasummary, and pass-through arguments toreadr::read_csv()via.... - Added
write_clean_csv()for writing data frames to CSV with clean column names. Appliesjanitor::clean_names()if column names are not already clean and reports affected columns via cli feedback. - Added
check_project()for auditing a project directory against toolero conventions. Checks for expected folders, an.Rprojfile,renv.lock, a git repository, a README, a.gitignore, and hidden files such as.RDataor.Rhistory. Operates in two modes: a cli report (default) or a tibble return for programmatic use (error = FALSE). - Added
qmd_to_r()for extracting R code chunks from any.qmdfile into a standalone.Rscript viaknitr::purl(). The output path defaults to the same directory as the input with the extension replaced. Thedocumentationargument controls how much context is preserved in the extracted script. - Added
generate_project_config()for writing a skeleton YAML project configuration file pre-filled with the standard toolero folder structure. Intended to be edited by the user and passed toinit_project()via the newconfigargument.filenameis required and explicit;pathdefaults to".". Anoverwriteargument (defaultFALSE) guards against accidental replacement of an existing config. The file extension is normalized to.ymlregardless of what is supplied. - Added Palmer Penguins attribution (Horst, Hill & Gorman, 2020) to the template
.qmd, thecreate_qmd()roxygen@detailssection, and a provenance note ininst/extdata/.
Breaking changes
-
init_project(): the standard folder structure has been revised to better reflect research workflow conventions established by The Carpentries and UW-Madison Libraries. The new standard set isdata-raw/,data/,scripts/,output/figures/,output/tables/, andreports/. The previous set (data/,data-raw/,images/,plots/,results/,scripts/,docs/,R/) is no longer created by default. -
init_project():extra_foldershas been renamed tocustom_folders. The argument now supports a dplyr-select-like syntax: bare names add folders (e.g."models"), names prefixed with"-"suppress creation of that folder from the resolved set (e.g."-output/figures"). Suppression removes only the named leaf – parent directories are preserved. Duplicate additions emit an informational message and are skipped; references to non-existent folders via"-"emit a warning. -
create_qmd(): no longer copiesstyles.cssandheader.htmlfrom the package into the project. Custom styling is now controlled exclusively by the newuse_styleargument. Projects that relied oncreate_qmd()copying UW-branded assets should useinit_project(uw_branding = TRUE)to scaffold those files, then passuse_style = TRUEtocreate_qmd()to wire them into the YAML. -
create_qmd(): sample data is now copied intodata-raw/instead ofdata/, consistent withinit_project()’s folder structure.
New features (continued from above)
-
init_project(): addedconfigargument. When supplied, the folder list in the YAML file replaces the built-in standard structure entirely.custom_foldersis still applied on top of the config-derived set. Configs are produced bygenerate_project_config()and can be stored in the user home directory for reuse across project types. -
create_qmd(): addedinclude_examplesargument (defaultTRUE). WhenTRUE, copies a sample dataset (sample.csv) intodata-raw/, a placeholder logo (logo.png) intoassets/, and uses a worked example template with aparamsblock referencing the sample data. WhenFALSE, creates a blank skeleton.qmdwith only the YAML header and a setup chunk – no sample data, no logo, no example analysis block. -
create_qmd(): addeduse_styleargument (defaultFALSE). AcceptsFALSE(no custom styling),TRUE(scansassets/for.cssand.htmlfiles), or a directory path (scans that directory instead). When exactly one.cssfile is found, it is added ascss:in the YAML. When exactly one.htmlfile is found, it is added asinclude-before-body:. If multiple files of either type are found, the function errors and asks the user to specify which one to use viayaml_data. This decouples styling frominit_project()and supports non-UW branding workflows. - Added
inst/templates/skeleton.qmd– a minimal Quarto template used wheninclude_examples = FALSE. Contains the YAML header, a setup chunk withlibrary(toolero), and a single placeholder heading. - Added
inst/templates/logo.png– a placeholder logo image copied intoassets/wheninclude_examples = TRUE. Reads “your logo goes here” so the user knows to replace it with their own branding.
Bug fixes
-
create_qmd():use_style = TRUEnow correctly copiesrci-banner.pngfrominst/assets/into the projectassets/directory. Previously the banner was only copied inside theinclude_examplesblock and was silently omitted whenuse_style = TRUEwas combined withinclude_examples = FALSE. -
create_qmd():filenameargument now normalizes the file extension to.qmdviafs::path_ext_set(). Passing"my-document"and"my-document.qmd"both producemy-document.qmd; a double extension is never added. -
init_project(): path construction now usesfs::path()throughout rather thanglue::glue("{path}/{folder}"), ensuring correct behavior on all platforms. -
init_project(): branding files are now copied frominst/assets/rather thaninst/extdata/, consistent with the rest of the package.
toolero 0.3.0
CRAN release: 2026-04-27
Breaking changes
-
create_qmd():filenameis now the first argument and has no default – it must be supplied explicitly.pathis now the second argument and defaults to".", allowing natural calls likecreate_qmd("analysis.qmd"). -
write_by_group(): sanitized output filenames now use-(dash) as the separator instead of_(underscore), consistent with the package convention that file names use dashes. Existing workflows that reference output paths by name will need to update accordingly. -
init_project(): thefile_pathargument has been renamed topathfor consistency withcreate_qmd()and the broader package API. Calls usingfile_path =by name will error; positional calls are unaffected.
New features
- Added
generate_kb_xml()to produce UW-Madison KB-importable XML files from rendered Quarto documents. Extracts metadata from the.qmdYAML header and re-renders with embedded resources for self-contained import. -
create_qmd(): addeduse_purlargument (defaultTRUE) that scaffolds a_quarto.ymlpost-render hook and apurl.Rscript for extracting R code from rendered documents intoR/.
Bug fixes
-
init_project(): now runsrenv::snapshot()and creates.renvignoreafterrenv::init(), ensuring the lockfile is populated and.qmdfiles are excluded from dependency scanning at project creation time. -
create_qmd():_quarto.ymlis now copied frominst/templates/rather than written from a hardcoded string, so changes to the template are reflected automatically. -
create_qmd():purl.Ris now correctly placed inR/instead of the project root, consistent with_quarto.ymlcallingRscript R/purl.R. -
create_qmd(): fixed YAML boolean serialization whenyaml_datais supplied.yaml::as.yaml()was convertingtrue/falsetoyes/no, which Quarto does not recognize. A custom handler now forces unquotedtrue/falseoutput. -
inst/templates/purl.R: replacedQUARTO_DOCUMENT_PATHenvironment variable approach withfs::dir_ls()glob scan, which works reliably regardless of how Quarto invokes the post-render script.
toolero 0.2.0
CRAN release: 2026-04-24
Breaking changes
-
create_qmd():pathis now a required argument with no default. PassingNULLor omitting it raises an error. Usetempdir()for temporary output. -
write_by_group():output_diris now a required argument with no default. PassingNULLor omitting it raises an error. Usetempdir()for temporary output. -
init_project():opennow defaults toFALSEinstead ofTRUEto avoid disrupting the current RStudio session in non-interactive contexts.
New features
- Added
detect_execution_context()to identify whether code is running in an interactive R session, aquarto rendercall, or a plainRscriptinvocation. Returns one of"interactive","quarto", or"rscript". - Added
create_qmd()to scaffold a new Quarto document from a reproducible template, including a sample dataset, UW-Madison branded assets, and three-context input resolution viadetect_execution_context(). Optionally pre-populates the YAML header from a user-supplied YAML config file. - Added
write_by_group()to split a data frame by a single grouping column and write each group to a separate CSV file. Filenames are derived from sanitized group values. Optionally writes amanifest.csvlisting output files, group values, and row counts.
toolero 0.1.1
New features
- Added
uw_brandingargument toinit_project(). WhenTRUE, creates anassets/folder in the new project and populates it with UW-Madison RCI branding files (styles.css,header.html,rci-banner.png).
