View source: R/assert_collection_addin.R
assertCollectionAddin | R Documentation |
RStudio Addin:
Inserts code for initializing and reporting a
checkmate assert collection
.
See `Details`
for how to set a key command.
assertCollectionAddin(add_comments = TRUE, insert = TRUE, indentation = NULL)
add_comments |
Whether to add comments around. (Logical) This makes it easy for a user to create their own addin without the comments. |
insert |
Whether to insert the code via
N.B. Mainly intended for testing the addin programmatically. |
indentation |
Indentation of the code. (Numeric) N.B. Mainly intended for testing the addin programmatically. |
After installing the package. Go to:
Tools >> Addins >> Browse Addins >> Keyboard Shortcuts
.
Find "Insert checkmate AssertCollection Code"
and press its field under Shortcut
.
Press desired key command, e.g. Alt+C
.
Press Apply
.
Press Execute
.
Inserts the following (excluding the ----
):
----
# Check arguments ####
assert_collection <- checkmate::makeAssertCollection()
# checkmate::assert_ , add = assert_collection)
checkmate::reportAssertions(assert_collection)
# End of argument checks ####
----
Returns NULL
invisibly.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
Other addins:
dputSelectedAddin()
,
initializeGXSFunctionAddin()
,
initializeTestthatAddin()
,
insertExpectationsAddin()
,
navigateTestFileAddin()
,
wrapStringAddin()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.