SUM_IF: Sums Vector Components Based On Condition

Description Usage Arguments Value Author(s) See Also Examples

View source: R/SUM_IF.R

Description

Takes two vectors, one being the vector you want to sum, and the other being the vector you want create a condition for. Then, specify the condition that should be used to satisfy the condition vector and it will aggregate the sum vector accordingly.

Usage

1
SUM_IF(sum_vector, condition_vector, condition)

Arguments

sum_vector

Vector that you would like to sum.

condition_vector

Vector that you would like condition specified for.

condition

Value that will satisfy certain components in condition vector.

Value

Returns summed value in the sum vector based on condition specified for condition vector.

Author(s)

Nick Bultman, njbultman74@gmail.com, September 2020

See Also

sum

Examples

1
2
SUM_IF(iris$Sepal.Length, iris$Species, "virginica")
SUM_IF(c(1, 2, 3), c(3, 1, 3), 3)

njbultman/xlsxFunctions documentation built on March 19, 2021, 6:54 p.m.