Skip to contents

'get_trend' compares values of two columns and produces a new column containing the trend result. The trend is represented by the strings: "Elevated" (increase), "Less Than Expected" (decrease), and "Expected" (no change).

Usage

get_trend(col1, col2)

Arguments

col1

List. Current data.

col2

List. Historical comparison data.

Value

Character vector containing the trend labels.

Examples

get_trend(c(5, 10, 10), c(3, 10, 12))
#> [1] "Elevated"           "Expected"           "Less Than Expected"