R/boa.importMatrix.R

"boa.importMatrix" <- function(prefix)
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
{
   link <- NULL

   import <- try({
      if(length(prefix) && exists(prefix))
         link <- as.matrix(get(prefix))
      else
         cat("Warning: import failed\n Could not find '", prefix, "'.\n",
             sep = "")
   }, TRUE)
   
   if(inherits(import, "try-error"))
      cat("Warning: import failed\n",
          " Object type is not supported.  Confirm that '", prefix, "' is a\n",
          " numeric matrix.\n", sep = "")

   return(link)
}

Try the boa package in your browser

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

boa documentation built on May 1, 2019, 9:12 p.m.