Description Usage Arguments Details Value Examples
Searches throughly through each line in a checkr_result to find a call to any of the functions listed in the dots. ...
1 2 | line_calling(ex, ..., n = 1L, message = "Didn't find matching function.",
just_the_fun = FALSE)
|
ex |
a checkr_result from a previous application of a checkr function, e.g. |
... |
unquoted functions to search for. A match to any one will trigger success. |
n |
an integer specifying which successful line to return. (Default: 1, the first.) |
message |
a character string to include in the checkr_result if the search is a failure. |
just_the_fun |
If TRUE, don't return the whole line, just the call involving the function |
The functions in ...
should be unquoted, e.g. sin
or lm
rather than "sin".
Note that infix functions, e.g. +
, -
, ||
, must be in backquotes: `+`
.
Like all checkr functions, if the input ex
is marked as a fail the output will be a short
circuit, that is, immediately returning the input unchanged.
A checkr_result with a pass, fail, or ok result. If a pass, the code component of the returned value will have the line found by the search. Otherwise it will contain the input code unaltered.
1 2 3 4 5 | code <- for_checkr("x <- 1; y <- x^2; z <- (y^2 + 7) / 2")
line_calling(code, `^`, message="Didn't find any line using exponentiation.")
line_calling(code, `^`, message="Didn't find any line using exponentiation.",
just_the_fun = TRUE)
line_calling(code, `^`, n = 2L, message = "Didn't find a second line using exponentiation.")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.