R/ejecuta.R

Defines functions ejecuta

Documented in ejecuta

#' Executes an Operating System Command
#'
#' @param command Command to be executed
#' @param intern If TRUE the outpus of the commasnd is passed into R.
#'
#' @return If intern=TRUE returns the oputput of the OS command, else returns the command.
#'
#' @export
#'
ejecuta <- function(command,intern=FALSE){
	if (Sys.info()[1]=="Linux"){
          kk=system(command, intern=intern, wait=TRUE)
    } else if (Sys.info()[1]=="Windows"){
          kk=shell(command, intern=intern, wait=TRUE)
    } else {
          cat("Sistema operativo desconocido\n")
    }
    if (intern) return(kk) else return(command)     
} 
pacoalonso/alonsaRp documentation built on May 17, 2020, 9 a.m.