View source: R/fct_inspection.R
do_check | R Documentation |
Checks whether variables fulfill a specific test.
do_check(
df,
v_vars,
check,
label_check,
template_ok = "all variables are {label_check}",
template_fail = "{var} is not {label_check}"
)
df |
a dataframe. |
v_vars |
character vector of variables on which to apply the test. |
check |
a function to apply to the 'vars'. |
label_check |
character string. Text describing the test to pass. |
template_ok |
character string. Text to display when a test is passed by a variable. |
template_fail |
character string. Text to display when a test is not passed by a variable. |
List containing the results of the check (checks), and a tibble of status and message for each test (messages). The list of messages in the result contains a single line if the test passed, or if a test failed for one or more variables, a line for each failure.
data(df_pa)
do_check(df = df_pa,
v_vars = c("u_pfs", "u_pd"),
check = ~ .x >= 0,
label_check = "positive"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.