A convenience wrapper around stamp_update() that extends the header's
copyright field to the current year, keeping the owner and start year (see
year_extend()).
Arguments
- file
Character. Path to a file or directory to update.
- action
Character. Action to perform: "modify", "dryrun", or "backup".
- recursive
Logical. When
fileis a directory, descend into subdirectories.- pattern
Character or NULL. When
fileis a directory, only update files whose name matches this pattern.
Examples
file <- tempfile(fileext = ".R")
writeLines(c("# Copyright (c) 2020", "# Author: Jane", "", "x <- 1"), file)
stamp_bump_year(file)
readLines(file)[1]
#> [1] "# Copyright (c) 2020-2026"