money: Money Functions

Description Usage Arguments Value Note Examples

Description

Functions for dealing with dollar formats imported from outside of R. Removes '$' symbol and ',' from dollar strings and converts to numeric. Changes numbers inside of paretheses to negative.

Usage

1
2
3
4
5
money_rm(x)

money_rm(x)

money_add(x, sig_fig = 3)

Arguments

x

an input vector: character for money_rm, numeric for money_add

sig_fig

Number of significant figures; must be coerceable to class integer and be greater than or equal to 0.

Value

A numeric vector.

Note

Other functions for money will go in this file.

Examples

1
2
3
4
money_string <- c("$1.04", "$2.24", "$2,000", "$235,658")
(no_money_string <- money_rm(money_string))
money_add(no_money_string)
money_add(x = c(1.04, 2.56e6, 3.545e9, -1.678e14))

JamesDalrymple/wccmh documentation built on May 7, 2019, 10:20 a.m.