Title: | Create Custom 'Rstudio' Keyboard Shortcuts |
---|---|
Description: | Create custom keyboard shortcuts to examine code selected in the 'Rstudio' editor. F3 can for example yield 'str(selection)' and F7 open the source code of CRAN and base package functions on 'github'. |
Authors: | Berry Boessenkool [aut, cre] |
Maintainer: | Berry Boessenkool <[email protected]> |
License: | GPL(>= 2) |
Version: | 0.4.15 |
Built: | 2025-01-07 04:59:33 UTC |
Source: | https://github.com/brry/rskey |
Rstudio addins to examine highlighted code / object. It can be very useful to bind these addins as outlined in https://github.com/brry/rskey#rstudio-addins-for-keyboard-shortcuts
str_addin( obj = selectobject(), use_glimpse = getOption("rskey_glimpse", FALSE) ) head_addin(obj = selectobject()) tail_addin(obj = selectobject()) View_addin(obj = selectobject()) funSource_addin(obj = selectobject(eval = FALSE)) summary_addin(obj = selectobject()) dim_addin(obj = selectobject()) class_addin(obj = selectobject()) plot_addin(obj = selectobject()) hist_addin(obj = selectobject()) unique_addin(obj = selectobject())
str_addin( obj = selectobject(), use_glimpse = getOption("rskey_glimpse", FALSE) ) head_addin(obj = selectobject()) tail_addin(obj = selectobject()) View_addin(obj = selectobject()) funSource_addin(obj = selectobject(eval = FALSE)) summary_addin(obj = selectobject()) dim_addin(obj = selectobject()) class_addin(obj = selectobject()) plot_addin(obj = selectobject()) hist_addin(obj = selectobject()) unique_addin(obj = selectobject())
obj |
List containing |
use_glimpse |
Logical: use |
Output of the respective functions
Berry Boessenkool, [email protected], May 2017
selectobject
,
berryFunctions::funSource
,
https://github.com/daattali/addinslist#readme
# Go to Addins - browse Addins - Keyboard shortcuts - map commands as desired # or use setKeyboardBindings() # highlight objects or code (examples below), then press keyboard shortcut iris iris$Sepal.Length + 10
# Go to Addins - browse Addins - Keyboard shortcuts - map commands as desired # or use setKeyboardBindings() # highlight objects or code (examples below), then press keyboard shortcut iris iris$Sepal.Length + 10
Create Roxygen documentation skeleton for a function
bdoc()
bdoc()
invisible charstring, but mainly used for writing into the source file directly
Berry Boessenkool, [email protected], Apr 2019
pass the filename (selected window) to knitPres::rnw2pdf
.
Developed when MikTex and Rstudio stopped talking to each other.
Can be schorcut to e.g. CTRL + K
bknit2pdf(open = TRUE, clean = TRUE, ...)
bknit2pdf(open = TRUE, clean = TRUE, ...)
open |
Open pdf file? |
clean |
Clean up temporary files? DEFAULT: TRUE (unlike in tools::texi2pdf) |
... |
Further arguments passed to |
invisible charstring with file name
Berry Boessenkool, [email protected], Jul 2021
wrap URL in Rnw source code in "href link text"
href()
href()
Berry Boessenkool, [email protected], Oct 2021
run python exercise development test
pycheck()
pycheck()
Berry Boessenkool, [email protected], Jan 2023
wrap Rnw source code in "\rcode"
rcode()
rcode()
Berry Boessenkool, [email protected], Nov 2019
Rstudio addin to create object from highlighted object name or code. Also works in browser mode, albeit not in the code_browser window.
selectobject(eval = TRUE)
selectobject(eval = TRUE)
eval |
Should text be evaluated? If FALSE, the output is a charstring of the marked text. DEFAULT: TRUE |
List with the (evaluated) object and the code generating it as a character string
Berry Boessenkool, [email protected], May 2017
Heavily borrowed from digital-dharma/RStudioAddIns (no longer online)
# see str_addin
# see str_addin
Set Rstudio keyboard bindings as mapped on https://github.com/brry/rskey#rskey. By default, this overwrites existing F3:F12 mappings!
setKeyboardBindings( overwrite = TRUE, removeLastYank = TRUE, workdir2filedir = TRUE, roampath = paste0(Sys.getenv("APPDATA"), "/RStudio/keybindings"), openfolder = TRUE )
setKeyboardBindings( overwrite = TRUE, removeLastYank = TRUE, workdir2filedir = TRUE, roampath = paste0(Sys.getenv("APPDATA"), "/RStudio/keybindings"), openfolder = TRUE )
overwrite |
Logical. Should existing mappings on F3, F4, ..., F12 be overwritten? Still informs if this occurs. DEFAULT: TRUE |
removeLastYank |
Logical. Should the annoying Rstudio default to override "Redo" (CTRL+Y) with some weird yank be removed? DEFAULT: TRUE (CTRL+Y becomes "Redo" again) |
workdir2filedir |
Logical. Set CTRL+H for setWorkingDirToActiveDoc? DEFAULT: TRUE |
roampath |
Char. If not NULL, both files are also copied to this path,
e.g. C:/Users/berry/AppData/Roaming/RStudio/keybindings.
Seems to be irrelevant in Rstudio 1.4.
DEFAULT: RStudio/keybindings folder at |
openfolder |
Logical: Open folder(s) after writing the files?
Uses |
Returns nothing
Berry Boessenkool, [email protected], Jan 2019
Convert Umlaute in Script to ASCII. Less aggressive than <https://github.com/dreamRs/prefixer/#not-ascii>
umlaut2ascii()
umlaut2ascii()
path, invisibly
Berry Boessenkool, [email protected], Feb 2022
[berryFunctions::convertUmlaut]