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:
%>%
, <<-
, %$%
, etc.),"c:\data\"
converted into "c:/data/"
) orInstall 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")
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 | ~~~~~~~~~~ |
Action | Function | Text to edit | Result |
---|---|---|---|
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 | 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 |
|
|
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 https://github.com/GegznaV/spMisc.