Skip to contents

Return a commentary snippet for one or more decimal values. Formats the numbers as a percentage and provides simple up/down commentary

Usage

percent_change(x, description = "up", unchanged_limit = 0.01, ...)

Arguments

x

a vector of percentage values, as a decimal E.g. 10% would be passed as 0.1.

description

code of descriptive words used in commentary. Defaults to "up"; up/down/unchanged.

unchanged_limit

numeric, the value below which you consider the parameter to not represent a change in either direction. Defaults to 0.01 (equal to 1%).

...

additional arguments to pass to the scales::percent function

Value

Returns a brief commentary (including the figure for increases or decreases) as a string