R/run.plink.R

Defines functions run.plink

run.plink <- function(cmd, plink2=FALSE) {

  # args <- list(...)
  if(plink2) {
    plink.exec <- getOption("Rplink.plink2.exec")
    if(is.null(plink.exec)) stop("Rplink.plink2.exec not defined in options.")
  } else {
    plink.exec <- getOption("Rplink.plink.exec")
    if(is.null(plink.exec)) stop("Rplink.plink.exec not defined in options.")
  }

  if(Sys.info()["sysname"] == "Windows") {
    Command <- "shell"
  } else {
    Command <- "system"
  }
  args <- list(paste(plink.exec, cmd))

  do.call(Command, args)

}
tshmak/Rplink documentation built on July 31, 2018, 5:14 a.m.