R/exec.R

Defines functions print.exec exec

Documented in exec

##' run system command
##'
##'
##' @title exec
##' @param command system command to run
##' @return An `exec` instance that stores system command outputs
##' @export
##' @author Guangchuang Yu
exec <- function(command) {
    res <- system(command, intern=TRUE)
    structure(res, class = "exec")
}

##' @method print exec
##' @export
print.exec <- function(x, ...) {
    cat(x, sep='\n')
}
    

Try the yulab.utils package in your browser

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

yulab.utils documentation built on Sept. 20, 2023, 9:06 a.m.