vector_value_occurrences | R Documentation |
Checks if a given value occurs a given number of times in a vector
vector_value_occurrences(
vec,
value,
exact_occurrences = NULL,
min_occurrences = NULL,
max_occurrences = NULL
)
vec |
The vector to check |
value |
The value to check |
exact_occurrences |
the exact number of times the value must be present. Takes precedence over min/max_occurrences. |
min_occurrences |
the minimum number of times (inclusive) the value must be present. |
max_occurrences |
the maximum number of times (inclusive) the value must be present. |
## Not run:
# For assertion
assertthat::assert_that(
qscheck::vector_value_occurrences(
vec, value, min_occurrences = 2, max_occurrences = 3
)
)
# For check
if (qscheck::vector_value_occurrences(
vec, value, min_occurrences = 2, max_occurrences = 3
)) {
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.