gxs_function() calllifecycle::badge("experimental")
Initializes the gxs_function() call with the arguments and default values
of the selected function.
See `Details` for how to set a key command.
initializeGXSFunctionAddin(selection = NULL, insert = TRUE, indentation = 0)Inserts gxs_function() call for
the selected function.
Returns NULL invisibly.
Name of function to test with gxs_function(). (Character)
N.B. Mainly intended for testing the addin programmatically.
Whether to insert the code 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
within the parent environment.
When the output is a function, it extracts the formals (arguments and default values)
and creates the initial `args_values` for gxs_function().
When the output is not a function, it throws an error.
After installing the package. Go to:
Tools >> Addins >> Browse Addins >> Keyboard Shortcuts.
Find "Initialize gxs_function()" and press its field under Shortcut.
Press desired key command, e.g. Alt+F.
Press Apply.
Press Execute.
Other expectation generators:
gxs_function(),
gxs_selection(),
insertExpectationsAddin()
Other addins:
assertCollectionAddin(),
dputSelectedAddin(),
initializeTestthatAddin(),
insertExpectationsAddin(),
navigateTestFileAddin(),
wrapStringAddin()