View source: R/wrap_string_addin.R
wrapStringAddin | R Documentation |
Splits the selection every n characters
and inserts it in a paste0()
call.
See `Details`
for how to set a key command.
wrapStringAddin( selection = NULL, indentation = 0, every_n = NULL, tolerance = 10, insert = TRUE )
selection |
String of code. (Character) N.B. Mainly intended for testing the addin programmatically. |
indentation |
Indentation of the selection. (Numeric) N.B. Mainly intended for testing the addin programmatically. |
every_n |
Number of characters per split. If
N.B. Strings shorter than |
tolerance |
Tolerance. Number of characters. We may prefer not to split a string that's only a few
characters too long. Strings shorter than |
insert |
Whether to insert the wrapped text via
N.B. Mainly intended for testing the addin programmatically. |
After installing the package. Go to:
Tools >> Addins >> Browse Addins >> Keyboard Shortcuts
.
Find "Wrap String with paste0"
and press its
field under Shortcut
.
Press desired key command, e.g. Alt+P
.
Press Apply
.
Press Execute
.
Inserts the following (with newlines and correct indentation):
paste0("first n chars", "next n chars")
Returns NULL
invisibly.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
Other addins:
assertCollectionAddin()
,
dputSelectedAddin()
,
initializeGXSFunctionAddin()
,
initializeTestthatAddin()
,
insertExpectationsAddin()
,
navigateTestFileAddin()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.