R/rthis.R

Defines functions r

Documented in r

#' Turn an R call into an Unix call
#'
#' @param code the function to call
#'
#' @return an unix R call
#' @export
#'
#' @examples
#' r(print("yeay"))
#' r(install.packages("plumber", repo = "http://cran.irsn.fr/"))
r <- function(code) {
  code <- paste(deparse(substitute(code)), collapse = " ")
  code <- gsub(" [2,]", " ", code)
  glue("R -e '{code}'")
}
ColinFay/dockerfiler documentation built on Nov. 16, 2023, 8:33 p.m.