R/getArgs.R

#' @export
getArgs <- function(MLCall){
  # Replace the function by caller
  bracketLocation <- gregexpr(pattern ='\\(',MLCall)[[1]][1]
  arguments       <- substr(MLCall,bracketLocation,nchar(MLCall))
  functionCall    <- paste("caller",arguments,sep="")
  
  # Get all arguments
  args <- eval(parse(text=functionCall))
  return(args)
}

#' @export
caller <- function(...){
  get_args()
}

#' @export
get_args <- function(){
  as.list( sys.call(sys.parent()) )[-1]
}

Try the parallelML package in your browser

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

parallelML documentation built on May 2, 2019, 2:44 a.m.