Skip to contents

Collects a set of named header updates into a reusable object you can inspect and apply to one or many files with stamp_update(). Each edit is a new value or a function of the field's current value, exactly as in stamp_update().

Usage

stamp_edits(...)

Arguments

...

Named header edits. Each value is a new value or a function of the field's current value (see year_extend() and author_add()).

Value

A stamp_edits object.

Examples

edits <- stamp_edits(copyright = year_extend(), author = author_add("Sam"))
edits
#> 
#> ── Header edits ──
#> 
#>copyright: extend the copyright year
#>author: add "Sam"

file <- tempfile(fileext = ".R")
writeLines(c("# Copyright (c) 2020", "# Author: Jane", "", "x <- 1"), file)
stamp_update(file, edits)