CRAN_Status_Badge GitHub version Travis-CI Build Status MIT licensed Last-update

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.

:key: Install package :key:

Install released version from CRAN:


Install development version from GitHub:

if (!require(devtools)) install.packages("devtools")
vignette("v1_workflow", package = "spAddins")


:zap: Available add-in functions :zap:

"Insert" family

These functions insert various R operators.

Function Inserts Package 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 either editing R Markdown files or, if commented (#), for structuring R code files.

Function Description Example (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 ~~~~~~~~~~

"Replace" family

Action Function Text to edit Result
Replace `\` with ` \\` Back2doubleBackSlash() c:\data\ c:\\data\\
Replace `\` with ` /` Back2ForwardSlash() c:\data\ c:/data/

"Enclose" family

These functions are useful for editing R Markdown files.

Action Function Text to edit Result In markdown interpreted 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 caret (^) enclose_with_caret() a superscript a superscript a superscript
Enclose with single tilde (~) enclose_with_tilde() a subscript a subscript a subscript
Enclose with double tilde (~~) enclose_with_tilde2() strikethrough strikethrough strikethrough
Enclose with single back tick ()</td> <td>enclose_with_backtick()</td> <td align="center">code</td> <td align="center">code` code
Enclose with single dollar sign ($</code>)</td> <td>enclose_with_dollar()</td> <td align="center">equation^{inline}</td> <td align="center"><code>$equation^{inline}$</code></td> <td align="center"><span class="math inline"><em>e</em><em>q</em><em>u</em><em>a</em><em>t</em><em>i</em><em>o</em><em>n</em><sup><em>i</em><em>n</em><em>l</em><em>i</em><em>n</em><em>e</em></sup></span></td> </tr> <tr class="even"> <td>Enclose with double dollar sign (<code>$$</code>)</td> <td>enclose_with_dollar2()</td> <td align="center">equation_{block}</td> <td align="center"><code>$equationblock$ equationblock

[1] Available at