initializeGXSFunctionAddin {xpectr} | R Documentation |
Initialize gxs_function()
call
Description
Initializes the gxs_function()
call with the arguments and default values
of the selected function.
See `Details`
for how to set a key command.
Usage
initializeGXSFunctionAddin(selection = NULL, insert = TRUE, indentation = 0)
Arguments
selection |
Name of function to test with N.B. Mainly intended for testing the addin programmatically. |
insert |
Whether to insert the code via
N.B. Mainly intended for testing the addin programmatically. |
indentation |
Indentation of the selection. (Numeric) N.B. Mainly intended for testing the addin programmatically. |
Details
How
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.
How to set up a key command in RStudio
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
.
Value
Inserts gxs_function()
call for
the selected function.
Returns NULL
invisibly.
Author(s)
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
See Also
Other expectation generators:
gxs_function()
,
gxs_selection()
,
insertExpectationsAddin()
Other addins:
assertCollectionAddin()
,
dputSelectedAddin()
,
initializeTestthatAddin()
,
insertExpectationsAddin()
,
navigateTestFileAddin()
,
wrapStringAddin()