Function to update the documentation in an R script with a package's most up-to-date version number.

update_package_version(
  file_name,
  prior_text_package = "#   * The package ",
  prior_text_version = " (version ",
  post_text_version = ")",
  overwrite = TRUE,
  display = FALSE
)

Arguments

file_name

A character string, the file name for the R script to update.

prior_text_package

A character string, the text preceding the package name.

prior_text_version

A character string, the text preceding the package's version number.

post_text_version

A character string, the text following the package's version number (can just be the initial few characters).

overwrite

Logical; if TRUE updates the original R script by overwriting its content.

display

Logical; if TRUE displays the updated R script content to the console window.

Value

Either as a side effect overwrites the original R script content or displays the updated content to the console window.