Skip to content

Commit

Permalink
FAQ article, some more updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hrecht committed Feb 22, 2024
1 parent c4ac250 commit f95e301
Show file tree
Hide file tree
Showing 26 changed files with 869 additions and 489 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# censusapi 0.9.0
* `getCensus()` automatically converts data columns in the Household Pulse Survey to numeric.
* Update examples in documentation to add new datasets, including more 2020 Decennial Census data and the Household Pulse Survey.
* A new online [frequently asked questions article](https://www.hrecht.com/censusapi/articles/frequently-asked-questions.html) improves documentation.
* Documentation is updated with new datasets, including more examples from the 2020 Decennial Census and the Household Pulse Survey.

# censusapi 0.8.0
* `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.
Expand Down
34 changes: 17 additions & 17 deletions R/getcensus_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,42 +159,42 @@ getFunction <- function(apiurl, name, key, get, region, regionin, time, year, da
#' @examples
#' \dontrun{
#' # Get total population and median household income for places (cities, towns, villages)
#' # in one state from the 5-year ACS.
#' # in a single state from the 5-year ACS.
#' acs_simple <- getCensus(
#' name = "acs/acs5",
#' vintage = 2020,
#' vintage = 2022,
#' vars = c("NAME", "B01001_001E", "B19013_001E"),
#' region = "place:*",
#' regionin = "state:01")
#' head(acs_simple)
#'
#' # Get all data from the B19013 variable group.
#' # Get all data from the B08301 variable group, "Means of Transportation to Work."
#' # This returns estimates as well as margins of error and annotation flags.
#' acs_group <- getCensus(
#' name = "acs/acs5",
#' vintage = 2020,
#' vars = c("B01001_001E", "group(B19013)"),
#' region = "place:*",
#' regionin = "state:01")
#' vintage = 2022,
#' vars = "group(B08301)",
#' region = "state:*)
#' head(acs_group)
#'
#' # Retreive 2010 Decennial Census block-level data within a specific tract,
#' # using the regionin argument to precisely specify the Census tract.
#' decennial_2010 <- getCensus(
#' name = "dec/sf1",
#' vintage = 2010,
#' vars = c("NAME","P001001"),
#' region = "block:*",
#' regionin = "state:36+county:027+tract:010000")
#' head(decennial_2010)
#' # Retreive 2020 Decennial Census block group data within a specific Census tract,
#' # using the regionin argument to precisely specify the Census tract, county,
#' # and state.
#' block_group <- getCensus(
#' name = "dec/dhc",
#' vintage = 2020,
#' vars = c("NAME", "P1_001N"),
#' region = "block group:*",
#' regionin = "state:36+county:027+tract:220300")
#' head(block_group)
#'
#' # Get poverty rates for children and for people of all ages over time using the
#' # Small Area Income and Poverty Estimates API
#' saipe <- getCensus(
#' name = "timeseries/poverty/saipe",
#' vars = c("NAME", "SAEPOVRT0_17_PT", "SAEPOVRTALL_PT"),
#' region = "state:01",
#' year = "2000:2019")
#' time = "from 2000 to 2022")
#' head(saipe)
#'
#' # Get County Business Patterns data for a specific NAICS sector.
Expand Down
2 changes: 2 additions & 0 deletions _pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ navbar:
menu:
- text: Getting started with censusapi
href: articles/getting-started.html
- text: Frequently asked questions
href: articles/frequently-asked-questions.html
- text: censusapi examples
href: articles/example-list.html
- text: Accessing microdata
Expand Down
1 change: 1 addition & 0 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/articles/accessing-microdata.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f95e301

Please sign in to comment.