Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: R  |  size: 0.29 KB  |  hits: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. checkfordir <- function(path){
  2.         return(isTRUE(file.info(path)$isdir));
  3. }
  4.  
  5. #because .libPaths() only appends paths, doesn't replace anything.
  6. setLibPaths <- function(newlibs){
  7.         newlibs <- newlibs[sapply(newlibs, checkfordir)]
  8.         assign(".lib.loc", newlibs, envir=environment(.libPaths));
  9. }