Skip to contents

Check the sum of a column or columns within a data frame.

Usage

check_sum(object, value, ...)

Arguments

object

Input data frame.

value

Numeric value to be checked against.

...

Column or columns in object to be summed and checked against value.

Value

Logical value indicating whether the sum of column or columns specified by ... is equal to value.

Examples

library(sefraInputs)
x <- data.frame(a = 1:10, b = runif(10), z = runif(10))
B <- sum(x$b)
Z <- sum(x$z)
check_sum(x, B, b)
#> [1] TRUE
check_sum(x, B + Z, b, z)
#> [1] TRUE
check_sum(x, B + Z, b:z)
#> [1] TRUE