Description Usage Arguments Value Examples
Expressions can use special functions like n()
that are allowed in
summarize
calls. This function should only be put in pipes after
group_by
has been called (so that groups exist).
1 2 | nickr_group(.data, cond, msg = "nickr_row", active = TRUE,
logger = stop)
|
.data |
Incoming data (omitted if in pipe). |
cond |
Condition written using column names and aggregation functions. |
msg |
User message to display if test fails. |
active |
Is this check turned on (default TRUE). Set FALSE to disable test (e.g., in production). |
logger |
Function to call with message (e.g., 'warning' or 'stop'). |
Input data without modification.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
data %>%
# Preliminary processing.
mutate(...) %>%
# Aggregation.
group_by(person_id) %>%
# Warn if there are less than 5 records in any group in production.
nickr_group(n() >= 5, msg = "Should have at least 5 records",
active = IN.PRODUCTION, logger = warning)
# Further processing on unmodified data.
summarize(...)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.