R/run_on.R

Defines functions run_on

#' What system is the code being run on
#'
#' Collates RStudio and R version information into
#' a character vector which can be used elsewhere.
#'
#' @param linebreak (Default: FALSE) - Should a
#' linebreak be appended to the 'run on' text?
#'
#' @noRd
run_on <- function(linebreak = FALSE) {
  out <- paste0(
    "# Written/run on RStudio ",
    rstudioapi::versionInfo()$mode, " ",
    rstudioapi::versionInfo()$version, " and R ",
    version$major, ".", version$minor
  )

  ifelse(linebreak, paste0(out, "\n"), out)
}
Health-SocialCare-Scotland/phstemplates documentation built on Nov. 6, 2024, 10:08 p.m.