currency.convert: Convert dollar values of acs object to a new base year.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/acs.R

Description

currency.convert provides a helper function to create a new copy of an acs-class object with a modified currency.year and converted dollar values without altering the original object.

Usage

1
currency.convert(object, rate="auto", newyear=NA_integer_, verbose=F)

Arguments

object

an acs object

rate

an optional rate to apply; "auto" (the default) will look up values from the cpi dataset.

newyear

an integer specifying the new value of currency.year to convert into

verbose

whether to print additional information about the conversion

Details

currency.convert provides a helper function to create a new copy of an acs-class object with a modified currency.year and converted dollar values without altering the original object. When rate="auto" (the default), currency.convert will look up values from the cpi database to use in conversion. When a numeric rate is provided through this option, actual cpi values are ignored. When verbose=T, currency.convert will provide additional information about the rates of conversion and the acs.colnames converted.

As of version 2.0 the package includes CPI data from 1913 through 2015, allowing conversion of dollar values for any years in this range.

Value

Returns a new acs object with updated dollar values and currency.year metadata.

Unlike currency.year<-, currency.convert does not alter the original object.

Author(s)

Ezra Haber Glenn [email protected]

See Also

currency.year

cpi

Examples

1
2
3
lawrence10                                   # median income data, endyear = 2010
currency.convert(lawrence10, newyear=2014)   # convert $$ to 2014 dollars 
currency.convert(lawrence10, newyear=1929)   # convert $$ to 1929 dollars

acs documentation built on Oct. 11, 2017, 1:03 a.m.