View source: R/flag_if_group.R
flag_if_group | R Documentation |
These functions extend flag_if()
] and detect_if()
to
work by groups defined with dplyr::group_by()
.
flag_if_group(.data, name, predicate, condition = warn, msg = NULL)
detect_if_group(.data, name, predicate)
.data |
A dataframe. |
name |
String. The name of a column of the dataframe. |
predicate |
A predicate function, e.g. |
condition |
A condition function, e.g. |
msg |
String to customize the returned message. |
flag_if_group()
: A condition and its first input, invisibly.
detect_if_group()
: Logical of length 1.
Other functions to check inputs:
check_crucial_names()
,
is_multiple()
Other functions for developers:
check_crucial_names()
,
extract_insensitive()
,
is_multiple()
,
nms_try_rename()
,
rename_matches()
,
type_ensure()
tree <- tibble(CensusID = c(1, 2), treeID = c(1, 2))
detect_if_group(tree, "treeID", is_multiple)
flag_if_group(tree, "treeID", is_multiple)
by_censusid <- group_by(tree, CensusID)
detect_if_group(by_censusid, "treeID", is_multiple)
flag_if_group(by_censusid, "treeID", is_multiple)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.