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}'")
}

Try the dockerfiler package in your browser

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

dockerfiler documentation built on Nov. 13, 2023, 5:09 p.m.