listCensusApis()
has new columns in the resulting
data frame of available API endpoints: the API contact
email address and type
: either Aggregate, Timeseries, or
Microdata.
listCensusMetadata()
has new functionality to use
value
metadata. This is particularly useful for some of the
economic datasets and the microdata APIs. Use
type = "variables"
and include_values = TRUE
to create a dictionary with all value labels for a given dataset. To get
value labels for a single variable in a given dataset, use
type = "values"
and
variable = "VARIABLE OF INTEREST"
.
Note: This metadata, while incredibly useful, only exists for some datasets. For other datasets you’ll still need to reference external files until the Census Bureau adds this functionality.
For example, get the value labels for the NAICS2017
in
the County Business Patterns dataset:
<- listCensusMetadata(
cbp_naics_values name = "cbp",
vintage = 2020,
type = "values",
variable = "NAICS2017")
Or make a full dictionary for the Current Population Survey Voting Patterns microdata API:
<- listCensusMetadata(
cbp_dict name = "cbp",
vintage = 2020,
type = "variables",
include_values = TRUE)
getCensus()
has a new option
convert_variables
re discussion in (#68) and (#80). The
default is TRUE
— as in previous versions, this converts
columns of numbers to R’s numeric data type. Setting
convert variables = FALSE
leaves all columns in the
original character data type returned by the Census Bureau.
getCensus()
has improved data binding for responses
from requests where more than 50 variables are manually specified.
Occasionally these large requests were not returned from the Census
Bureau in the same order, leading to mismatched rows. This fixes
(#82).
listCensusMetadata()
now properly handles metadata
attribute names in the new Microdata APIs that contain invalid JSON.
This fixes (#84).
Documentation and examples are updated. There is a new vignette: Accessing microdata.
YEAR
to
getCensus()
per changes to some timeseries endpoints that
previously used TIME
as a parameter.listCensusMetadata()
and masterlist examples
that used Business Dynamic Statistics endpoints, which were recently
deprecated.show_call
option to getCensus()
,
which shows the underlying API call (otherwise only shown on errors) and
link to package documentation when used.getCensus()
. This allows users to specify any valid API
argument name and pass it a value, giving full access to all of the
underlying Census Bureau APIs.group
parameter in
listCensusMetadata()
. This allows users to get variable
metadata for a specified variable group.listCensusMetadata()
.region
an optional argument in
getCensus
, rather than required.fips
dataset with
zeroes.groups
type option to
listCensusMetadata
.listCensusMetadata
variables call caused
by an underlying Census API change, which renamed
validValues
to values
for some endpoints.dec/sf1
endpoint, which will replace 2010 sf1
endpoint on August 30, 2018.listCensusMetadata
variables call caused
by underlying Census API changes.listCensusMetadata
. For
most APIs, this function will run in under one second. A lag may be
noticeable for the American Community Survey APIs, which each have more
than 40,000 variables. Improvements are planned in future releases.listCensusMetadata
allows full word or single letter
argument in type
parameterlistCensusApis
, in starts of removing XML dependency. The
.json data also includes several fields not present in the .html file,
the most useful of which are added to the returned data frame.listCensusMetadata
examples,
mainly for build/checks speed.getCensus(key)
argument’s default value to be
CENSUS_KEY in .Renviron. Explicitly encourages Census key to be added to
.Renviron. (Users can always override this with any given input.)