| Start |
|---|
| .Rprofile - the first chunk of code executed
Important note: if you use RStudio, you can have a separate Here are some examples of code that you might include in an .Rprofile file. Setting your R home directorySetting page size optionsset the default help typeset a site librarySet a CRAN mirrorSetting the location of your libraryThis will allow you to not have to install all the packages again with each R version update. Custom shortcuts or functionsSometimes it is useful to have a shortcut for a long R expression. A common example of this setting an active binding to access the last top-level expression result without having to type out Because .Rprofile is just an R file, it can contain any arbitrary R code. Pre-loading the most useful packagesThis is bad practice and should generally be avoided because it separates package loading code from the scripts where those packages are actually used. See AlsoSee |
.Rprofile example StartupOptionsCustom FunctionsRemarksThere is a nice chapter on the matter in Efficient R programming (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference