Changelog
Source:NEWS.md
Version 0.23.0
CRAN release: 2024-12-07
New Features
Now
sysinfo()reports also on Ark (An R Kernel) and Positron via flagsarkandpositron.startup(debug = TRUE)does a better job explaining why certain Renviron and Rprofile files are skipped.Add support for
R_STARTUP_RDATA="warn", which will warn about the existance of a.RDatafile with information of its size and timestamp. This can be combined with"remove"and"rename", e.g.R_STARTUP_RDATA="warn,remove".Add support for sending debug output to file, which is controlled by R option
startup.debug.fileand environment variableR_STARTUP_DEBUG_FILE. For example,R_STARTUP_DEBUG_FILE=Rprofile.logwill output debug messages toRprofile.login the working directory where R is launched. If not specified, the debug is outputted viamessage()as before.
Bug Fixes
-
startup()did not processRprofile.d/files in Positron, because Positron adds--no-init-fileto the command-line arguments, despite being ignored by Positron.
Version 0.22.0
CRAN release: 2024-07-29
New Features
startup()gained argumentencoding, which controls the encoding used to parse the R startup files.Now
sysinfo()report also on Jupyter, Visual Studio Code (VSCode) webR via flagsjupyter,vscode, andwebr.Now
install()anduninstall()respect environment variableR_PROFILE_USER, if specified.Now
startup()ignores files and folders specific to version control, e.g..git,.gitignore,.hg,.hgignore, and.svn.
Version 0.21.0
CRAN release: 2023-12-11
Version 0.20.0
CRAN release: 2023-04-03
New Features
sysinfo()gained flagrapp, which isTRUEwhen running R from the R.app GUI on macOS. This flag equalssysinfo()$gui == "AQUA".sysinfo()gained flagrgui, which isTRUEwhen running R from the Rgui GUI on MS Windows. This flag equalssysinfo()$gui == "Rgui".startup::startup(debug = TRUE)now reports on anyRconsoleconfigure file processed when running R via the Rgui graphical user interface (GUI) available on MS Windows.
Bug Fixes
startup::check()no longer warns when R sets environment variablesR_LIBS_USERandR_LIBS_SITEto the default folders that do not exist by default.startup::check()would report on an incorrect default value if R optionencodingorstringsAsFactorswas set during startup to an unsafe value.
Version 0.19.0
CRAN release: 2022-10-16
New Features
An R script in environment variable
R_STARTUP_FILEwill be evaluated bystartup::startup()after Renviron and Rprofile files have been processed, and after anyR_STARTUP_INITcode. For example,R_STARTUP_FILE="setup.R" Rlaunches R, processes all R startup files, and at the end parses and evaluates file ‘setup.R’.sysinfo()gained fieldquiet, which is TRUE ifRorRscriptwas called with command-line options-q,--quiet, or--silent.sysinfo()gained fieldsave, which is TRUE ifRorRscriptwas called with command-line options--save, FALSE if called with--no-save, and otherwise NA.
Version 0.18.0
CRAN release: 2022-05-14
New Features
Now
startup::startup(debug = TRUE)reports on any environment variables, options, global variables, locale settings that were added, removed, and changed while processing an Rprofile file.startup::startup(debug = TRUE)now reports on any changes to the current working directory and the R library path while processing an Rprofile file.startup::startup(debug = TRUE)already reported on updates to the state of R’s random number generator (RNG). Now it also reports on updates to the RNG kind, including what the change was.
Version 0.17.0
CRAN release: 2022-02-23
New Features
startup::startup()now searches for Renviron.d/ and Rprofile.d/ (note, without leading periods) in user’s configuration folder in a way that is compatible withtools::R_user_dir()of R (>= 4.0.0) and that follows operating-system standards. For example, for Linux ~/.config/R/startup/, for macOS ~/Library/Preferences/org.R-project.R/R/startup/, and for MS Windows %LOCALAPPDATA%/R/cache/R/startup/. If environment variableXDG_CONFIG_HOMEis set, then ${XDG_CONFIG_HOME}/R/startup/ is used. For now,startup::install()will continue to create ~/.Renviron.d/ and ~/.Rprofile.d/ by default.startup::install()gained argumentmake_dirsto control whether directories .Renviron.d/ and .Rprofile.d/ should be created, if missing.Add
on_session_enter()for registering R functions and expressions to be evaluated at the end of R’s startup process via a custom.First()that is added to the global environment. If there is a.First()function on the search path, including any preexisting one in the global environment, that is called at the end.Add
on_session_exit()for registering R functions and expressions to be called at the very end when the R session terminates.Now
startup()warns about non-standard, platform-specific capitalization of Renviron and Rprofile file names. For example, although ~/.RProfile works on MS Windows and macOS with non-case sensitive file systems, the officially supported file name is ~/.Rprofile.Now
startup(debug = TRUE)reports on.Last()and.Last.sys().Now
startup(debug = TRUE)gives a note if it detects that an Rprofile script updated the state of R’s random number generator (RNG).Harmonized cache folder options toward
tools::R_user_dir()of R (>= 4.0.0).
Version 0.16.0
CRAN release: 2021-11-20
New Features
Now
startup(debug = TRUE)reports onR_SCRIPT_DEFAULT_PACKAGES.Now
startup(debug = TRUE)reports ontempdir()and environment variablesTMPDIR,TMP, andTEMPthat controls the root of the temporary folder.Now it is sufficient to call
startup(dryrun = TRUE)to see what the R startup would have been. Previously one would also have to specifydebug = TRUE.Now
startup(debug = TRUE)reports on packages loaded, attached, unloaded, and detached per Rprofile file processed. It also reports on other environments attached and detached.Now
startup(debug = TRUE)reports also on the Rprofile file in the base package, i.e.system.file("R", "Rprofile", package = "base").startup::startup(check = TRUE)no longer warns if environment variablesR_LIBS_SITEorR_LIBS_USERhave value NULL, which in R (>= 4.2.0) corresponds to setting them to be empty.
Version 0.15.0
CRAN release: 2020-09-03
New Features
startup(debug = TRUE)now reports on number of lines and file size also for theR_TESTSfile.startup(debug = TRUE)[sic!] now checks that the environment variables that the different Renviron files set are actually set and produce an informative warning message if not. This confirms that, at least for R 4.0.2 for Windows, Rgui does not process ~/.Renviron unless Rgui is launched from that folder.Using regular, non-fancy single quotes in any output produced.
Version 0.14.1
CRAN release: 2020-04-01
New Features
- Add R options as an alternative to corresponding environment variables, e.g. added
startup.disable(R_STARTUP_DISABLE),startup.init(R_STARTUP_INIT), andstartup.rdata(R_STARTUP_RDATA).
Documentation
- Add
help("startup.options", package = "startup"), which lists environment variables and R options that the startup package use.
Bug Fixes
The new default of option
stringsAsFactorsin R (>= 4.0.0) would trigger a startup warning.It was not possible to disable the validation of R option
errorand environment variables such asR_LIBS_USER,R_PROFILE_SITE, andR_CHECK_ENVIRON. These validations can now be disabled by specifying argumentcheck = FALSE, or the corresponding R option, or environment variable. Validation oferrorspecifically can be disable by adding"error"to environment variableR_STARTUP_CHECK_OPTIONS_IGNOREor to optionstartup.check.options.ignore. The default is to ignoreerror.
Version 0.14.0
CRAN release: 2019-12-09
Significant Changes
-
startup(all = TRUE)now processes any startup folders in the home directory before those in the current working directory. Previously it was vice verse. With the new way, it is possible to override settings made in ~/.Renviron.d/ or ~/.Rprofile.d/ with custom ones in local ./.Renviron.d/ and ./.Rprofile.d/ folders.
New Features
Setting environment variable
R_STARTUP_RDATAto"remove"will cause an existing ‘./.RData’ file to be skipped by automatically removing it. If"rename", it will be renamed to ‘./.RData.YYYYMMDD_hhmmss’ where the timestamp is the last time the file was modified. If"prompt", then the user is prompted whether they want to load the file or rename it. In non-interactive session,"prompt"will fallback to loading by default. To fallback to renaming the file, use"prompt,rename". Thus, settingR_STARTUP_RDATA=renamein an .Renviron file will make sure no .RData file is ever loaded while still preserving them.RStudio Console: The only way to prompt a user during the R startup process in the RStudio Console is via a graphical popup window. Because of this,
R_STARTUP_RDATA=promptwill trigger a popup window in RStudio if there is a .RData file.
Bug Fixes
startup(debug = TRUE)would not only report on the name of an environment variable, but also parts of its value, if the value contained equal signs.The source information, that is, the filename and line locations, were dropped from functions defined via
startup(). To get the filename where a function was defined usegetSrcFilename(my_fcn, full.names = TRUE).RStudio: Using renv together with
startup()while in the RStudio Console would produce a false warning on theerroroption being set.
Version 0.13.0
CRAN release: 2019-10-27
New Features
startup::startup()will return immediately without processing R startup files if environment variableR_STARTUP_DISABLEis set to TRUE.Added flag
radiantosysinfo()indicating whether R runs in radian (previously known as rtichoke and rice) or not. Please stop using thericeandrtichokeflags.The
startup::startup()code snipped injected in the .Rprofile file bystartup::install()now prefix error messages with ‘.Rprofile error:’ to help troubleshooting errors.
Bug Fixes
The validation of
R_LIBS,R_LIBS_SITE,R_LIBS_USERbystartup::check()had a_R_CHECK_LENGTH_1_LOGIC2_bug.The startup checks asserting that
update.packages()is not called would pick up not only those with the period (‘.’) but any character in that position.
Deprecated and Defunct
-
startup::startup()no longer warn about startup files with non-declared key names being skipped. This warning was introduced in startup 0.10.0 due to how such files were filtered out.
Version 0.12.0
CRAN release: 2019-05-27
Significant Changes
Renviron and Rprofile startup files that use
<key>!=<value>filters with non-defined keys are now included. Previously they were skipped. Note that<key>=<value>files are indeed skipped when<key>is not defined.startup()now produces an informative warning if it detects that an R option that is considered unsafe to change from its default, e.g. changingencodingother than in interactive mode may break package installations and changingstringsAsFactorswill summon the dead.
New Features
Added support for
when=<periodicity>file declarations, where<periodicity>can be ‘once’, ‘hourly’, ‘daily’, ‘weekly’, ‘fortnightly’, and ‘monthly’. A startup file with such a declaration will be processed at most once per<periodicity>, e.g. a file with ‘when=daily’ somewhere in the pathname will be processed once per day. The periodicity is based on the walltime in the local time zone, e.g. if a file with ‘when=daily’ was processed one minute before midnight, it will be processed again if an R session is started one minute past midnight. Updating the file timestamp of a ‘when’ file will reset its timer.Code in environment variable
R_STARTUP_INITwill now be evaluated bystartup::startup()after Renviron and Rprofile files have been processed. For example,R_STARTUP_INIT="x <- 1" Rwill launch R withx == 1.startup(debug = TRUE)now also reports on.First().The messages of warnings and errors produced by the startup package itself now mention which startup function they originate from. This helps to identify the origin of these when produced during the R startup process.
Added
warn(), which produces a warning with information on which R source file it was produced in, if any.
Miscellaneous
- Renamed example folders .Renviron.d/ and .Rprofile.d/ installed as part of the package to Renviron.d/ and Rprofile.d/ without the leading period. This was simply done to avoid
R CMD check --as-cranNOTEs.
Bug Fixes
-
startup()did not ignore files with names such as #foo.R#.
Deprecated and Defunct
- Removed defunct
renviron()andrprofile(). Userenviron_d()andrprofile_d().
Version 0.11.0
CRAN release: 2018-08-25
New Features
startup(debug = TRUE)now also displays the expanded path to any file or folder listed. It also gives information on files that known environment variables (e.g.R_ENVIRON_USER) point to. For Renviron files, it also reports on names of the environment variables set in each of those files.startup(debug = TRUE)reports on the search path and loaded namespaces, and what packages will be attached after R’s startup finishes.Added character
dirnametosysinfo()specifying the basename of the current working directory.startup(check = TRUE), warns ifR_ENVIRON,R_ENVIRON_USER,R_PROFILE,R_PROFILE_USER,R_BUILD_ENVIRON, orR_CHECK_ENVIRONspecifies non-existing files.startup::check(fix = TRUE)now returns the pathnames of any files that needed to be fixed and was successfully updated.RStudio:
startup()now gives an informative warning if optionerroris set during the R startup and it will be overridden by RStudio’s debug settings.Windows: Calling
startup::restart()in the Windows RGui now produces an error clarifying that the RGui cannot be restarted this way.
Bug Fixes
startup::install()would append thestartup::startup()statement to the last line in .Rprofile if that line (incorrectly) did not have a newline.startup::startup(check = TRUE)would give “Error in if (!eof_ok(file)) { argument is of length zero” on Windows if the Rprofile file checked is a symbolic link.
Version 0.10.0
CRAN release: 2018-03-30
Significant Changes
- Renviron and Rprofile startup files that use
<key>=<value>filters with non-declared keys are skipped. Previously they were always processed. This update makes it easier to include “secrets”, e.g. files in folder ~/.Renviron.d/private/SECRET=banana/ will only be included if the environment variableSECRETis set to exactly ‘banana’. An informative warning, which can be disabled, will be produced by startup 0.10.* until startup 0.11.0 is released.
New Features
Added
is_debug_on()which returns TRUE if the startup debug mode is on. To control the debug mode, see?startup::startup.startup(debug = TRUE)reports on severalR_*environment variables.restart()gained argumentquietfor controlling whether the restart should be quiet or not.Added flag
microsoftrtosysinfo()indicating whether R runs in Microsoft R Open or not.Added flag
pqrtosysinfo()indicating whether running pqR (“A Pretty Quick # Version of R”), or not.Added flag
rstudiotermtosysinfo()indicating whether R runs in an RStudio Terminal or not. To test whether R runs via the RStudio Console, use therstudioflag.Added flag
rtichoketosysinfo()indicating whether R runs in rtichoke (previously known as Rice) or not. Please stop using thericeflag and start using thertichokeinstead (both have identical values).The
essflag ofsysinfo()is now based on whether “ESSR” is insearch()or not - used to check for environment variableEMACSequaling “t” or not.Now
startup::restart()also work when running R via rtichoke.
Bug Fixes
startup::restart()would not work in the RStudio Terminal. Note that it does not work in the RStudio Console due to limitations in RStudio.On Windows,
startup::startup()would produce a false warning on non-existingR_LIBS_USERfolders.
Version 0.9.0
CRAN release: 2018-01-10
New Features
- Added
restart()for restarting the current R session. It can also be used to adjust various R command-line arguments and environment variables, e.g.restart(as = "R CMD build")mimics theR CMD buildsetup as far as possible.
Version 0.8.0
CRAN release: 2017-10-19
New Features
Added
startup::current_script()which returns the .Rprofile.d/ pathname that is currently processed bystartup::startup().Added flag
ricetosysinfo()indicating whether R runs via Rice or not, meaning it can be used as a file and directory name tag, e.g. rice=TRUE.startup(debug = TRUE)outputs much more information on what has taken place and what will take place through R’s startup process.startup()gained argumentcheckfor controlling whether the content of startup files should be validated or not.check(), and therefore alsostartup(check = TRUE), warns ifR_LIBS,R_LIBS_SITE, orR_LIBS_USERspecifies non-existing directory.
Deprecated and Defunct
-
renviron()andrprofile()are now defunct. Removedapi()$renviron()andapi()$rprofile(). Userenviron_d()andrprofile_d()instead.
Version 0.7.0
CRAN release: 2017-09-07
New Features
Convenient session details are now gathered and recorded as R options immediately after processing ‘.Renviron.d’ files. These options, prefixed
startup.session., are available while processing ‘.Rprofile.d’ files and, by default, also afterstartup::startup()has completed. For information on session details recorded, seehelp("startup_session_options").Added a package vignette (available only in R >= 3.0.2).
Version 0.6.1
CRAN release: 2017-05-17
Bug Fixes
-
startup()ignores more of the hidden files and folders that macOS may create and which should not be sourced during startup. For instance, when copying a file ‘foo.R’ to a non-macOS file system, an auxiliary file ‘._foo.R’ may be created as well.
Version 0.6.0
CRAN release: 2017-05-01
New Features
New conditional
<key>=<value>specification: an unknown<key>(i.e. one that is not one of the knownsysinfo()fields or ‘package’) will be interpreted as the name of an environment variable. For instance, files path/LANGUAGE=en/*.R will be included only if system environment variableLANGUAGEequals ‘en’ (or is not set).startup::install()now injectstry(startup::startup())such thatinstall.packages("startup")will work even when startup is not installed, e.g. after a major-version R update.startup::install()andstartup::uninstall()now output messages on what is done and why, and they now return the R startup file modified. They also produce a warning if startup is already installed or uninstalled, respectively.startup::install()gained argumentoverwriteto control whether to append (default) to a pre-existing R startup file or to overwrite it.ROBUSTNESS: Backups now assert that not only the backup files are created, but also that they have the same file size as the original file.
Version 0.5.0
CRAN release: 2017-02-13
New Features
Startup directory or file names that start with two or more periods are now excluded, e.g. ~/.Rprofile.d/..hide/test.R.
startup()protects against attempts to update R packages also viapacman::p_up()in addition toutils::update.packages().Added flag
esstosysinfo()indicating whether R runs under Emacs Speaks Statistics (ESS) or not.startup(debug = TRUE)detects ifR_TESTSis set and reports which the file is and that the base package has already processed it.
Bug Fixes
- Now
startup()ignores macOS files named .DS_Store and directories named __MACOSX (and their content). Previously, such files could result in startup errors.
Version 0.4.0
CRAN release: 2016-12-22
New Features
Now it is possible to do negated filename specifications, e.g. hpc,package=future/os!=windows.
Filename flags can now be specified a TRUE, FALSE, T, F, 1, and 0 (non-case sensitive), e.g. interactive=false and interactive=0.
Added element
guitosysinfo().Added flags
rstudioandwinetosysinfo()indicating whether R runs via RStudio and via Linux Wine, respectively.New conditional
<key>=<value>specification: Directory and file names containing apackage=<name>specification will be processed if and only if package<name>is installed.Errors occurring while sourcing an Rprofile file now also contain information about in file the error occurred. Lines with invalid syntax in Renviron files are ignored with a message outputted saying so. Due to limitations in how
base::readRenviron()works, it is not possible to detect these errors nor capture the outputted message.Now objects are auto printed to match the behavior of the R startup process.
startup(debug = TRUE)now outputs time stamps since start per entry.
Deprecated and Defunct
-
renviron()andrprofile()were renamed torenviron_d()andrprofile_d(), respectively.
Version 0.2.0
New Features
- Add arguments
sibling = FALSEtostartup(). Ifsibling = TRUE, the corresponding startup file needs to exist in the same location as the directory in order for the directory to be processed.