##  This file resides in ~/git/misc/rscripts/Rprofile.site
##    and should be symlinked to as needed
##  
##  symlink destination should be:   
##     [R_HOME]/etc/Rprofile.site
##
##  To find [R_HOME] run this line from shell
#      Rscript --vanilla -e 'cat("\n\n  ", R.home(), "\n\n\n")'
## 
##  MAC OSX: 
#      sudo ln -s ~/git/misc/rscripts/Rprofile.site /Library/Frameworks/R.framework/Resources/etc/Rprofile.site
##
## LINUX: 
#     sudo ln -s ~/git/misc/rscripts/Rprofile.site /usr/lib64/R/etc/Rprofile.site
##  

if (!file.exists("~/.Rprofile") && file.exists("~rsaporta/.Rprofile"))
  source("~rsaporta/.Rprofile")

# Wrappers for quick exit
qn <- function() quit("no")
qy <- function() quit("yes")

if (!exists(".us")) {
    .us <- function() {
          options("utilsLoaded"=FALSE)  ## Indicates that this file has been loaded

          warning ("\n\n  This is the bare-bones .us() from the Rprofile.site file.\n  Run again after this time")
          try(source("~rsaporta/git/misc/rscripts/utilsRS.r"))  

          if (!isTRUE(getOption("utilsLoaded")))
              stop("The utils file did NOT load correctly did NOT load correctly")

          return(invisible(NULL))
    }
}