Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

readRStudioPreference

Read RStudio Preference


Description

Reads an internal RStudio IDE preference for the current user.

Usage

readRStudioPreference(name, default)

Arguments

name

The name of the preference.

default

The default value of the preference, returned if the preference is not found.

Details

RStudio IDE internal preferences include the values displayed in RStudio's Global Options dialog as well as a number of additional settings.

Note

The readRStudioPreference function was added in version 1.3.387 of RStudio.

See Also

readPreference, which can be used to read arbitrary user (non-RStudio) preferences set with writePreference.

link{writeRStudioPreference}, which can be used to write internal RStudio IDE preferences.

Examples

## Not run: 
# Get indentation settings
spaces <- rstudioapi::readRStudioPreference("num_spaces_for_tab", FALSE)
message("Using ", spaces, " per tab.")

## End(Not run)

rstudioapi

Safely Access the RStudio API

v0.13
MIT + file LICENSE
Authors
Kevin Ushey [aut, cre], JJ Allaire [aut], Hadley Wickham [aut], Gary Ritchie [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.