percent_lost: Function to calculate the percentage lost between two values.

View source: R/percentage_change.R

percent_lostR Documentation

Function to calculate the percentage lost between two values.

Description

Function to calculate the percentage lost between two values.

Usage

percent_lost(value, value_two, as_decimal = FALSE)

Arguments

value

Numeric vector of values.

value_two

Numeric vector of values.

as_decimal

Should the percentage be represented in a 0 to 1 scale?

Value

Numeric vector with length of value.

Author(s)

Stuart K. Grange

Examples


# Check the calculation, take 20 from 100
percent_lost(100, 80)

# Take 1693.2 from 33864
percent_lost(33864, 32170.8)
percent_lost(33864, 32170.8, as_decimal = TRUE)


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.