Forrest logo
back to the R tool

r:tldr:ab047

r: Start R in vanilla mode (i.e. a blank session that doesn't save the workspace at the end).
$ R --vanilla
try on your machine

The command "R --vanilla" is used to start an instance of the R programming language in a simplified, basic environment.

When you run "R" in a terminal or command prompt, it starts the interactive R environment, allowing you to execute commands and scripts. By default, R loads various configuration files and environment variables, and it may also load packages or libraries that were used in previous sessions.

However, when you add the "--vanilla" option, it tells R to start in a fresh and basic state. This means that it ignores the user's default settings and doesn't read or save any initialization files. It also skips the automatic execution of the ".Rprofile" file, which can contain customizations or commands that are executed each time R starts.

Using "R --vanilla" can be useful in certain scenarios, such as:

  1. Troubleshooting: If you encounter issues or unexpected behavior in R, starting it with "--vanilla" can help identify whether the problem is related to your customization or some other factor.
  2. Reproducibility: When sharing or reproducing code, starting R in vanilla mode ensures that the session begins with the same basic environment for everyone, avoiding potential inconsistencies due to user configurations.
  3. Batch processing: For automated or scripted processes, "--vanilla" can be helpful in preventing unwanted interference from user-specific settings or preferences.

Overall, the "R --vanilla" command provides a clean slate for running R without any customizations, making it a useful option in various scenarios.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the R tool