Skip to contents

parse_income_range extracts dollar figures from income bucket ranges used in Census data and elsewhere

Arguments

income_range

a character vector containing income ranges, e.g. "b. $18,201 to $37,000", "$400-$499 ($20,800-$25,999)"

limit

either "lower" (the default) and "upper" bounds of the range, or "mid" to return the mid-point

max_income

numeric value of 'and over' value of the highest bracket. Inf by default. If NULL, returns a max_income value equal to the lower bound of the highest bracket. Important for limit = "mid" or limit = "upper".

is_zero

a character vector of values to be interpreted as zero. Defaults to c("Nil income").

negative_as_zero

a boolean value. If TRUE (the default) the character

dollar_prefix

a character string to denote the dollar delimiter. "$" by default, but could be e.g. "AUD" or "USD". string "Negative income" is interpreted as 0. If FALSE, NA is returned.

.silent

a boolean value. If FALSE (the default), the function will warn that NA(s) were returned.

.print_lookup

If TRUE prints lookup table displaying inputted income range and the returned parsed value.

Value

a numeric vector of incomes