lifecycle::badge("experimental")
RStudio Addin:
Runs dput() on the selected code and inserts
it instead of the selection.
See `Details` for how to set a key command.
dputSelectedAddin(selection = NULL, insert = TRUE, indentation = 0)Inserts the output of running
dput() on the selected code.
Does not return anything.
String of code. (Character)
E.g. "stop('This gives an expect_error test')".
N.B. Mainly intended for testing the addin programmatically.
Whether to insert the expectations via
rstudioapi::insertText()
or return them. (Logical)
N.B. Mainly intended for testing the addin programmatically.
Indentation of the selection. (Numeric)
N.B. Mainly intended for testing the addin programmatically.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
Parses and evaluates the selected code string,
applies dput() and
inserts the output instead of the selection.
After installing the package. Go to:
Tools >> Addins >> Browse Addins >> Keyboard Shortcuts.
Find "dput() Selected" and press its field under Shortcut.
Press desired key command, e.g. Alt+D.
Press Apply.
Press Execute.
Other addins:
assertCollectionAddin(),
initializeGXSFunctionAddin(),
initializeTestthatAddin(),
insertExpectationsAddin(),
navigateTestFileAddin(),
wrapStringAddin()