A Set of RStudio Addins

A set of RStudio addins that are designed to be used in combination with user-defined RStudio keyboard shortcuts. These addins either: 1) insert text at a cursor position (e.g. insert operators %>%, <<-, %$%, etc.), 2) replace symbols in selected pieces of text (e.g., convert backslashes to forward slashes which results in stings like "c:\data\" converted into "c:/data/") or 3) enclose text with special symbols (e.g., converts "bold" into "**bold**") which is convenient for editing R Markdown files.




R package spAddins

spAddins is an R package that provides a set of RStudio addins which are designed to be used in combination with user-defined RStudio keyboard shortcuts. These addins either:

  1. insert text at the cursor position (e.g. insert operators %>%, <<-, %$%, etc.),
  2. replace symbols in selected pieces of text (e.g., convert backslashes to forward slashes which results in strings like "c:\data\" converted into "c:/data/") or
  3. enclose text with special symbols (e.g., converts "bold" into "**bold**" that is interpreted as "bold") which is convenient for editing R Markdown files.

Install released version from CRAN:

install.packages("spAddins")

Install development version from GitHub:

if (!require(devtools)) install.packages("devtools")
library(devtools)
install_github("GegznaV/spAddins")
vignette("v1_workflow", package = "spAddins")
 
browseVignettes("spAddins")

:zap: Available add-in functions :zap: -------------------------------------- These functions insert various R operators.

FunctionInsertsPackage associated with operator
insertArrowLR2_Addin()<<-R base
insertArrowRL_Addin()->R base
insertArrowRL2_Addin()->>R base
insertIn_Addin()%in%R base
insertMatMuliplication_Addin()%*%R base
insertPipeline_Addin()%>%magrittr
insertTeeOperator_Addin()%T>%magrittr
insertCompAssignPipe_Addin()%<>%magrittr
insertExPipe_Addin()%$%magrittr
insertIfNULL_Addin()%if.NULL%spMisc[1]
insert_if_null_Addin()%if_null%spMisc
insert_if_null_or_len0_Addin()%if_null_or_len0%spMisc
insertNotIn_Addin()%!in%spMisc
insertPaste_Addin()%.+.%spMisc
insertPaste0_Addin()%++%spMisc

The following functions may be useful for editing R Markdown files or, if commented (#), for structuring R code files.

FunctionDescriptionExample (first 10 symbols)
insert_ss_line_Addin()Insert single straight (SS) line----------
insert_ds_line_Addin()Insert double straight (DS) line==========
insert_sw_line_Addin()Insert single wavy (SW) line~~~~~~~~~~
ActionFunctionText to editResult
Replace `\` with ` \\`Back2doubleBackSlash()c:\data\c:\\data\\
Replace `\` with ` /`Back2ForwardSlash()c:\data\c:/data/

These functions are useful for editing R Markdown files.

Action Function Text to edit Result Interpreted in markdown as
Enclose with single asterisk (*) enclose_with_asterisk() italics *italics* italics
Enclose with single underscore (_) enclose_with_underscore() italics _italics_ italics
Enclose with double asterisk (**) enclose_with_asterisk2() bold **bold** bold
Enclose with double underscore (__) enclose_with_underscore2() bold __bold__ bold
Enclose with single back tick (` ) enclose_with_backtick() code `code` code
Enclose with single dollar sign ($) enclose_with_dollar() equation^{inline} $equation^{inline}$ equationinline
Enclose with single dollar sign ($$) enclose_with_dollar2() equation_{block} $$equation_{block}$$ equationblock

[1] Available at https://github.com/GegznaV/spMisc.

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("spAddins")

0.2.0 by Vilmantas Gegzna, 5 hours ago


https://github.com/GegznaV/spAddins


Report a bug at https://github.com/GegznaV/spAddins/issues


Browse source code at https://github.com/cran/spAddins


Authors: Vilmantas Gegzna [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports rstudioapi, magrittr, stringr, purrr

Suggests knitr, rmarkdown, rebus


See at CRAN