From 4de96637df1b555a7d0eed284755db559ac134a9 Mon Sep 17 00:00:00 2001 From: Hannah Recht Date: Tue, 26 Mar 2024 14:54:45 -0400 Subject: [PATCH] organize vignettes vs web articles re #97 and more pkgdown n tweaks --- .Rbuildignore | 6 +- DESCRIPTION | 1 + NEWS.md | 5 +- R/metadata_functions.R | 12 +- README.md | 4 +- _pkgdown.yaml | 18 + docs/404.html | 3 + docs/CODE_OF_CONDUCT.html | 3 + docs/articles/accessing-microdata.html | 5 +- docs/articles/example-list.html | 223 +++--- docs/articles/frequently-asked-questions.html | 5 +- docs/articles/getting-started.html | 7 +- docs/articles/index.html | 5 + docs/authors.html | 3 + docs/index.html | 7 +- docs/news/index.html | 8 +- docs/pkgdown.yml | 3 +- docs/reference/fips.html | 5 +- docs/reference/getCensus.html | 11 +- docs/reference/getFunction.html | 5 +- docs/reference/index.html | 44 +- docs/reference/listCensusApis.html | 179 ++++- docs/reference/listCensusMetadata.html | 5 +- docs/reference/makeVarlist.html | 5 +- docs/search.json | 2 +- docs/sitemap.xml | 3 + man/listCensusApis.Rd | 9 +- vignettes/accessing-microdata.Rmd | 100 --- vignettes/example-list.Rmd | 646 ------------------ vignettes/frequently-asked-questions.Rmd | 114 ---- vignettes/getting-started.Rmd | 244 ------- 31 files changed, 428 insertions(+), 1262 deletions(-) delete mode 100644 vignettes/accessing-microdata.Rmd delete mode 100644 vignettes/example-list.Rmd delete mode 100644 vignettes/frequently-asked-questions.Rmd delete mode 100644 vignettes/getting-started.Rmd diff --git a/.Rbuildignore b/.Rbuildignore index 83c72d4..4f4d00b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,9 +9,5 @@ pkgdown/ ^pkgdown$ .github/ ^.github$ -vignettes/getting-started.Rmd -vignettes/example-list.Rmd -vignettes/advanced-usage.Rmd -vignettes/accessing-microdata.Rmd -vignettes/frequently-asked-questions.Rmd ^\.github$ +^vignettes/articles$ diff --git a/DESCRIPTION b/DESCRIPTION index 37ba22e..dbcc84e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,3 +19,4 @@ Suggests: knitr, rmarkdown Encoding: UTF-8 +VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 2668b2e..79cc297 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,12 +16,13 @@ apis_timeseries <- listCensusApis(name = "timeseries") ``` ## Minor improvements -* `getCensus()` automatically converts data columns in the Household Pulse Survey to numeric. +* `getCensus()` automatically converts data columns from the Household Pulse Survey (`name = "timeseries/hps"`) to numeric. ## Documentation * Function documentation is improved and better formatted. -* A new online [frequently asked questions article](https://www.hrecht.com/censusapi/articles/frequently-asked-questions.html) improves documentation. * Examples are updated to use newly released datasets. +* A new online [frequently asked questions article](https://www.hrecht.com/censusapi/articles/frequently-asked-questions.html) improves documentation. +* A new vignette included in the package build directs users to the website to read web-only articles. # 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. diff --git a/R/metadata_functions.R b/R/metadata_functions.R index 31f11c9..43013d6 100644 --- a/R/metadata_functions.R +++ b/R/metadata_functions.R @@ -10,30 +10,30 @@ #' this needs to be the left-most part of the dataset name before `/`, e.g. #' "timeseries/eits" or "dec" or "acs/acs5". #' @param vintage Optional vintage (year) of dataset. -#' @export #' @examples #' \dontrun{ #' # Get information about every dataset available in the APIs #' apis <- listCensusApis() #' head(apis) #' -#' Get information about all vintage 2022 datasets +#' # Get information about all vintage 2022 datasets #' apis_2022 <- listCensusApis(vintage = 2022) #' head(apis_2022) #' -#' Get information about all timeseries datasets +#' # Get information about all timeseries datasets #' apis_timeseries <- listCensusApis(name = "timeseries") #' head(apis_timeseries) #' -#' Get information about 2020 Decennial Census datasets +#' # Get information about 2020 Decennial Census datasets #' apis_decennial_2020 <- listCensusApis(name = "dec", vintage = 2020) #' head(apis_decennial_2020) #' -#' Get information about one particular dataset +#' # Get information about one particular dataset #' api_sahie <- listCensusApis(name = "timeseries/healthins/sahie") #' head(api_sahie) #' } - +#' +#' @export listCensusApis <- function(name = NULL, vintage = NULL) { constructURL <- function(name, vintage) { diff --git a/README.md b/README.md index 4763a44..dd4cf9f 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ [![R-CMD-check](https://github.com/hrecht/censusapi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hrecht/censusapi/actions/workflows/R-CMD-check.yaml) -`censusapi` is a lightweight package to get data from the U.S. Census Bureau's [APIs](https://www.census.gov/data/developers.html). More than [1,000 Census API endpoints](https://api.census.gov/data.html) are available, including the Decennial Census, American Community Survey, Poverty Statistics, Population Estimates, and Census microdata. This package is designed to let you get data from all of those APIs using the same main functions and syntax for every dataset. +`censusapi` is a lightweight package to get data from the U.S. Census Bureau's [APIs](https://www.census.gov/data/developers.html). More than [1,500 Census API endpoints](https://api.census.gov/data.html) are available, including the Decennial Census, American Community Survey, Poverty Statistics, Population Estimates, and Census microdata. This package is designed to let you get data from all of those APIs using the same main functions and syntax for every dataset. -`getCensus()` is designed to work with any new Census API endpoint when it is released, as long as it conforms to Census's existing standards. The package also includes metadata functions so that users determine [which datasets](https://www.hrecht.com/censusapi/reference/listCensusApis.html) are available and [for each dataset](https://www.hrecht.com/censusapi/reference/listCensusMetadata.html), what variables, geographies, and groups can be used. +The package also includes metadata functions to help users determine [which datasets](https://www.hrecht.com/censusapi/reference/listCensusApis.html) are available and the variable, geography, and other options [each of them contains](https://www.hrecht.com/censusapi/reference/listCensusMetadata.html). ## Installation Get the latest stable release from CRAN: diff --git a/_pkgdown.yaml b/_pkgdown.yaml index ec3aa50..f75e8bb 100644 --- a/_pkgdown.yaml +++ b/_pkgdown.yaml @@ -10,7 +10,12 @@ template: paragraph-margin-bottom: 1.5rem navbar: + structure: + left: [start, reference, articles, news] components: + start: + text: Get started + href: articles/getting-started.html articles: text: Articles menu: @@ -23,5 +28,18 @@ navbar: - text: Accessing microdata href: articles/accessing-microdata.html +reference: +- title: "Get data" + contents: + - getCensus +- title: "Get metadata" + contents: + - listCensusApis + - listCensusMetadata + - makeVarlist +- title: "Helpers" + contents: + - fips + redirects: - ["articles/example-masterlist.html", "articles/example-list.html"] diff --git a/docs/404.html b/docs/404.html index 56ee8f2..632b0a8 100644 --- a/docs/404.html +++ b/docs/404.html @@ -34,6 +34,9 @@ @@ -2448,16 +2451,16 @@

Economic Census54 -08 -4616 -Y +02 +17328 +T 02 54 02 -17328 -T +320 +Y 02 54 @@ -3129,6 +3132,24 @@

Household Pulse Survey60 +2022 +1 +11.4 +40.0 +December 9, 2022 +December 19, 2022 +52 + + +2022 +1 +11.2 +34.1 +March 30, 2022 +April 11, 2022 +44 + + 2023 1 12.1 @@ -3194,22 +3215,13 @@

Household Pulse Survey 2022 1 -11.4 -40.0 -December 9, 2022 -December 19, 2022 -52 - - -2022 -1 11.0 39.5 November 2, 2022 November 14, 2022 51 - + 2022 1 11.4 @@ -3218,7 +3230,7 @@

Household Pulse SurveyOctober 17, 2022 50 - + 2022 1 11.5 @@ -3227,7 +3239,7 @@

Household Pulse SurveySeptember 26, 2022 49 - + 2022 1 11.5 @@ -3236,7 +3248,7 @@

Household Pulse SurveyAugust 8, 2022 48 - + 2022 1 11.9 @@ -3245,7 +3257,7 @@

Household Pulse SurveyJuly 11, 2022 47 - + 2022 1 11.1 @@ -3254,7 +3266,7 @@

Household Pulse SurveyJune 13, 2022 46 - + 2022 1 11.2 @@ -3263,15 +3275,6 @@

Household Pulse SurveyMay 9, 2022 45 - -2022 -1 -11.2 -34.1 -March 30, 2022 -April 11, 2022 -44 - 2022 1 @@ -4017,10 +4020,9 @@

Public Sector Statistics2021 25 Annual Survey of School System Finance -SS0708 -Current spending - Support services - Other and -nonspecified support services -418997 +SS0701 +Current spending - Support services - Total +6185866 06 001 @@ -4028,9 +4030,10 @@

Public Sector Statistics2021 25 Annual Survey of School System Finance -SS0701 -Current spending - Support services - Total -6185866 +SS0702 +Current spending - Support services - Pupil support +services +1551012 06 001 @@ -4038,10 +4041,10 @@

Public Sector Statistics2021 25 Annual Survey of School System Finance -SS0702 -Current spending - Support services - Pupil support -services -1551012 +SS0703 +Current spending - Support services - Instructional +staff support services +902090 06 001 diff --git a/docs/articles/frequently-asked-questions.html b/docs/articles/frequently-asked-questions.html index 059523b..ac2688d 100644 --- a/docs/articles/frequently-asked-questions.html +++ b/docs/articles/frequently-asked-questions.html @@ -38,6 +38,9 @@ diff --git a/docs/articles/getting-started.html b/docs/articles/getting-started.html index da6be8b..5d3f100 100644 --- a/docs/articles/getting-started.html +++ b/docs/articles/getting-started.html @@ -38,10 +38,13 @@ diff --git a/docs/authors.html b/docs/authors.html index 4a00005..c2b8e67 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -19,6 +19,9 @@

-

censusapi is a lightweight package to get data from the U.S. Census Bureau’s APIs. More than 1,000 Census API endpoints are available, including the Decennial Census, American Community Survey, Poverty Statistics, Population Estimates, and Census microdata. This package is designed to let you get data from all of those APIs using the same main functions and syntax for every dataset.

-

getCensus() is designed to work with any new Census API endpoint when it is released, as long as it conforms to Census’s existing standards. The package also includes metadata functions so that users determine which datasets are available and for each dataset, what variables, geographies, and groups can be used.

+

censusapi is a lightweight package to get data from the U.S. Census Bureau’s APIs. More than 1,500 Census API endpoints are available, including the Decennial Census, American Community Survey, Poverty Statistics, Population Estimates, and Census microdata. This package is designed to let you get data from all of those APIs using the same main functions and syntax for every dataset.

+

The package also includes metadata functions to help users determine which datasets are available and the variable, geography, and other options each of them contains.

Installation

diff --git a/docs/news/index.html b/docs/news/index.html index 70aec3d..1b224fc 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -19,6 +19,9 @@

Documentation

  • Function documentation is improved and better formatted.
  • -
  • A new online frequently asked questions article improves documentation.
  • Examples are updated to use newly released datasets.
  • +
  • A new online frequently asked questions article improves documentation.
  • +
  • A new vignette included in the package build directs users to the website to read web-only articles.
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 50b7cdb..9c665ee 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -6,7 +6,8 @@ articles: example-list: example-list.html frequently-asked-questions: frequently-asked-questions.html getting-started: getting-started.html -last_built: 2024-03-26T16:37Z + censusapi: censusapi.html +last_built: 2024-03-26T18:50Z urls: reference: https://www.hrecht.com/censusapi/reference article: https://www.hrecht.com/censusapi/articles diff --git a/docs/reference/fips.html b/docs/reference/fips.html index 96ff99e..dc85389 100644 --- a/docs/reference/fips.html +++ b/docs/reference/fips.html @@ -20,7 +20,10 @@