R/rprofile.r

load_user_rprofile = function () {
  user_rprofile = Sys.getenv('R_PROFILE_USER', '~/.Rprofile')

  if (file.exists(user_rprofile)) {
    tryCatch(
      {
        sys.source(user_rprofile, envir = .GlobalEnv)
        TRUE
      },
      error = \(e) {
        warning(simpleWarning(conditionMessage(e), conditionCall(e)))
        FALSE
      }
    )
  } else {
    TRUE
  }
}

Try the rprofile package in your browser

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

rprofile documentation built on Nov. 2, 2023, 5:06 p.m.