rskey

rstudio addins for Keyboard shortcuts

Rstudio addins to examine selected code in the Rstudio editor.
Berry Boessenkool (berry-b@gmx.de), 2017-2026

Quick setup

install.packages("remotes")
# remotes::install_github("brry/rskey")
install.packages("rskey", repos = c('https://brry.r-universe.dev', 'https://cloud.r-project.org'))
rskey::setKeyboardBindings()
# moves existing shortcuts to backup file

selectively (un)set some manually:

label the keyboard if wanted :)

funSource

funSource provides an easy option to open the source code of a function in a browser window.
Through github, there are nice syntax highlighting and search options.

find package

funSource(someFunction) tries to find the corresponding package to the input function.
You can also explicitly request funSource("somePackage::someFunction").
This works even if the package is not installed (in which case you do need the quotation marks).

open urls

In the default browser, it opens the first link if it exists, the second if not:

The second link is a github search query needed when a function is defined in a file with a different name.
Functions in the base R packages will be searched in the wch/r-source/src/library repo.

limits

Currently, the funSource-initiated github search doesn't find names or dimnames in base R. Any idea to solve this kind of limitation is welcome!

origin

funSource is imported from berryFunctions.
The selectobject code idea is from digital-dharma/RStudioAddIns).

examples

Examples on links opened by funSource:

Functions in CRAN packages - ggplot2::aes:
https://github.com/cran/ggplot2/blob/master/R/aes.R
https://github.com/search?q=aes function repo:cran/ggplot2+path:R

Functions in base packages - graphics::hist:
https://github.com/wch/r-source/blob/trunk/src/library/graphics/R/hist.R
https://github.com/search?q=hist function repo:wch/r-source+path:src/library/graphics/R