The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Package {rstudio.prefs}


Title: Manage 'RStudio' Preferences and Addin Shortcuts
Version: 0.3.0
Description: Provides an interface for working with 'RStudio' preference files to modify settings and addin shortcuts without using point-and-click option menus. Useful for ensuring a unified experience across devices and for enforcing best practices. Also exposes some settings not available in the Global Options dialog.
License: GPL (≥ 3)
URL: https://github.com/vdwulp/rstudio.prefs, https://vdwulp.github.io/rstudio.prefs/
BugReports: https://github.com/vdwulp/rstudio.prefs/issues
SystemRequirements: RStudio (>= 1.3)
Depends: R (≥ 3.5)
Imports: cli (≥ 2.5.0), dplyr (≥ 1.0.6), fs (≥ 1.5.0), jsonlite (≥ 1.7.2), purrr (≥ 0.3.4), rappdirs (≥ 0.3.3), rlang (≥ 0.4.11), rstudioapi (≥ 0.13), rvest (≥ 1.0.0), tibble (≥ 3.1.2)
Suggests: covr (≥ 3.5.1), spelling (≥ 2.2), testthat (≥ 3.0.0), withr (≥ 2.3.0)
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Config/roxygen2/version: 8.1.0
Config/roxygen2/markdown: TRUE
NeedsCompilation: no
Packaged: 2026-09-26 12:54:17 UTC; wulps
Author: S.A. van der Wulp [aut, cre, cph], Daniel D. Sjoberg ORCID iD [aut, cph]
Maintainer: S.A. van der Wulp <vdwulp@gmail.com>
Repository: CRAN
Date/Publication: 2026-09-26 13:20:02 UTC

rstudio.prefs: Manage 'RStudio' Preferences and Addin Shortcuts

Description

logo

Provides an interface for working with 'RStudio' preference files to modify settings and addin shortcuts without using point-and-click option menus. Useful for ensuring a unified experience across devices and for enforcing best practices. Also exposes some settings not available in the Global Options dialog.

Author(s)

Maintainer: S.A. van der Wulp vdwulp@gmail.com [copyright holder]

Authors:

See Also

Useful links:


Check Min RStudio Version

Description

Return error if minimum version requirement not met.

Usage

check_min_rstudio_version(version)

Arguments

version

string of min required version number

Value

Called for its side effect; aborts with an error if the version requirement is not met, otherwise returns invisibly.

Author(s)

Daniel D. Sjoberg

Examples

if (interactive()) {
  check_min_rstudio_version("1.3")
}

Fetch RStudio Preferences

Description

Fetches the listing of supported preferences from the RStudio documentation.

Usage

fetch_rstudio_prefs()

Details

Only preferences of type "boolean", "string", "number", "integer" and "array" are returned. Preferences of type "object" are currently not supported and are ignored.

Value

A tibble containing the RStudio preference definitions.

Examples

fetch_rstudio_prefs()


Normalize Path Add-in

Description

Wrapper to execute fs::path_norm() as a shortcut on highlighted text. The updated text will be converted in place to a path normalized for the environment currently in use. For instance, \ or \\ will be converted to / on Windows machines. See below for process of setting shortcut.

Usage

make_path_norm()

Details

Add keyboard shortcut for make_path_norm() in RStudio, use the use_rstudio_keyboard_shortcut() function. Do add it manually, follow the instructions below.

Value

normalized path string

See Also

fs::path_norm

Examples

if (interactive()) {
  # set a keyboard shortcut for path normalization
  rstudio.prefs::use_rstudio_keyboard_shortcut(
    "Ctrl+Shift+/" = "rstudio.prefs::make_path_norm"
  )
}

Convert secondary repo string to named list

Description

The secondary repo string uses | to separate the repo names and their values, as well as two different repos, e.g. 'ropensci|https://ropensci.r-universe.dev|username|https://username.r-universe.dev'.

Usage

repo_string_as_named_list(x)

Arguments

x

secondary repository string from "rstudio-prefs.json" –> "cran_mirror" –> "secondary"

Value

named list

Author(s)

Daniel D. Sjoberg (2021-2022)

S.A. van der Wulp (since 2026)

Examples

repo_string_as_named_list(
  'ropensci|https://ropensci.r-universe.dev|username|https://username.r-universe.dev'
)


RStudio Config Path

Description

Copy of the internal function usethis:::rstudio_config_path()

Usage

rstudio_config_path(...)

Arguments

...

strings added to the RStudio config path

Value

path string to RStudio rstudio-prefs.json file

Author(s)

Daniel D. Sjoberg

Examples

if (interactive()) {
  rstudio_config_path()
}

Set RStudio Keyboard Shortcuts

Description

This function updates the RStudio keyboard shortcuts saved in the addins.json file.

Usage

use_rstudio_keyboard_shortcut(..., .write_json = TRUE, .backup = TRUE)

Arguments

...

series of RStudio keyboard shortcuts to update. The argument name is the keyboard shortcut, and the value is a string of the function name that will execute, or NULL to remove the shortcut. If a new shortcut shares a key or function with an existing one, the previous binding is removed.

.write_json

logical indicating whether to update and overwrite the existing JSON file of options. Default is TRUE. When FALSE, the function will return a list of all shortcuts, instead of writing them to file.

.backup

logical indicating whether to create a back-up of shortcuts file before it's updated. Default is TRUE.

Value

When .write_json = FALSE, a named list of all shortcuts including the updates. Otherwise NULL invisibly.

Author(s)

Daniel D. Sjoberg (2021-2022)

S.A. van der Wulp (since 2026)

Examples


# Add a shortcut
use_rstudio_keyboard_shortcut(
  "Ctrl+Shift+/" = "rstudio.prefs::make_path_norm"
)

# Remove a shortcut
use_rstudio_keyboard_shortcut(
  "Ctrl+Shift+/" = NULL
)


Set RStudio Preferences

Description

Updates RStudio preferences in rstudio-prefs.json.

Usage

use_rstudio_prefs(...)

Arguments

...

a series of RStudio preferences to update, e.g. ⁠always_save_history = FALSE, rainbow_parentheses = TRUE⁠

Details

Preference names, types, and allowed string values are validated against the official RStudio preference definitions before applying changes. A full listing of preferences is available in the RStudio documentation.

Value

Invisibly returns the updated preferences as a named list on success, or NULL if no updates were made (no changes, user aborted, or not in an interactive session).

Author(s)

Daniel D. Sjoberg (2021-2022)

S.A. van der Wulp (since 2026)

Examples


# Pass preferences individually
use_rstudio_prefs(
  always_save_history = FALSE,
  rainbow_parentheses = TRUE
)

# Pass a list of preferences
pref_list <-
  list(always_save_history = FALSE,
       rainbow_parentheses = TRUE)

use_rstudio_prefs(!!!pref_list)

# Pass array type preference
use_rstudio_prefs(
  busy_exclusion_list = list("tmux", "screen")
)


Set RStudio Secondary Repository

Description

Updates the secondary repositories in rstudio-prefs.json.

Usage

use_rstudio_secondary_repo(...)

Arguments

...

a series of named secondary repositories, e.g. ropensci = "https://ropensci.r-universe.dev". Pass NULL to remove a repository, e.g. ropensci = NULL. If a URL is passed under a new name, the old name is removed.

Value

Invisibly returns the updated cran_mirror preference as a named list on success, or NULL if no updates were made (no changes, user aborted, or not in an interactive session).

Author(s)

Daniel D. Sjoberg (2021-2022)

S.A. van der Wulp (since 2026)

Examples


# Add a repository
use_rstudio_secondary_repo(
  ropensci = "https://ropensci.r-universe.dev",
  username = "https://username.r-universe.dev"
)

# Remove a repository
use_rstudio_secondary_repo(ropensci = NULL)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.