View source: R/format_template.R
contains_non_total | R Documentation |
This function checks if any column in a data frame contains values that are not part of a given set of totals.
contains_non_total(data, totals)
data |
A data frame containing the data to be checked. |
totals |
A vector of values considered as totals. |
A logical value: TRUE
if at least one non-total value exists, otherwise FALSE
.
## Not run:
df <- data.frame(
col1 = c("A", "B", "TOTAL"),
col2 = c("X", "TOTAL", "TOTAL")
)
contains_non_total(df, c("TOTAL"))
# Returns TRUE
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.