R/annotate_script.R

Defines functions annotate_script

Documented in annotate_script

#' Annotate script
#'
#' @param script_file Path to an R script.
#' @param pkg_field Field from package description to retrieve, defaults to
#'   "Title".
#'
#' @return Prints the annotated script to the console.
#'
#' @export
annotate_script <- function(script_file, pkg_field = "Title") {
  strlines <- readr::read_file(script_file)
  annttd <- annotate_pkg_calls(strlines, pkg_field)
  writeLines(annttd)
}

Try the annotater package in your browser

Any scripts or data that you put into this service are public.

annotater documentation built on May 29, 2024, 9:58 a.m.