diff --git a/NEWS.md b/NEWS.md index 790cebe4..1aba5dd8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,15 @@ # ipumsr (development version) -* Improved parsing of labeled values included in "codInstr" tags in the DDI - codebook for microdata extracts. +## New features + +* Added API support for IPUMS DHS (`"dhs"`). DHS extracts can now be defined, + submitted, and downloaded via the IPUMS API using the same workflow as other + microdata collections. + +## Bug fixes + +* Improved parsing of labeled values included in "codInstr" tags in the DDI + codebook for microdata extracts (#94). # ipumsr 0.9.0 diff --git a/R/api_define_extract.R b/R/api_define_extract.R index a550e78d..be0fda0f 100644 --- a/R/api_define_extract.R +++ b/R/api_define_extract.R @@ -96,6 +96,7 @@ NULL #' + [IPUMS USA](https://usa.ipums.org/) #' + [IPUMS CPS](https://cps.ipums.org/) #' + [IPUMS International](https://international.ipums.org/) +#' + [IPUMS DHS](https://www.idhsdata.org/idhs/) #' + IPUMS Time Use ([ATUS](https://www.atusdata.org/atus/), [AHTUS](https://www.ahtusdata.org/ahtus/), [MTUS](https://www.mtusdata.org/mtus/)) #' + IPUMS Health Surveys ([NHIS](https://nhis.ipums.org/), [MEPS](https://meps.ipums.org/)) #' diff --git a/R/api_helpers.R b/R/api_helpers.R index 3c2fcf7b..58cbdf1d 100644 --- a/R/api_helpers.R +++ b/R/api_helpers.R @@ -18,6 +18,7 @@ #' * IPUMS International (`"ipumsi"`) #' * IPUMS Time Use (`"atus"`, `"ahtus"`, `"mtus"`) #' * IPUMS Health Surveys (`"nhis"`, `"meps"`) +#' * IPUMS DHS (`"dhs"`) #' * IPUMS NHGIS (`"nhgis"`) #' * IPUMS IHGIS (`"ihgis"`) #' diff --git a/R/api_metadata.R b/R/api_metadata.R index f39f6f85..31f63c7b 100644 --- a/R/api_metadata.R +++ b/R/api_metadata.R @@ -264,6 +264,7 @@ get_metadata <- function(collection, #' get_sample_info("ipumsi") #' get_sample_info("atus") #' get_sample_info("meps") +#' get_sample_info("dhs") #' } get_sample_info <- function(collection = NULL, delay = 0, @@ -291,7 +292,8 @@ catalog_types <- function(collection) { "ahtus" = "samples", "mtus" = "samples", "nhis" = "samples", - "meps" = "samples" + "meps" = "samples", + "dhs" = "samples" ) endpts[[collection]] diff --git a/R/proj_config.R b/R/proj_config.R index e8e52cf4..586c1464 100644 --- a/R/proj_config.R +++ b/R/proj_config.R @@ -117,6 +117,7 @@ proj_config <- function() { url_name = "idhs", collection_type = "microdata", code_for_api = "dhs", + api_support = TRUE, home_url = "https://www.idhsdata.org/", var_url = function(var = "group") { get_var_url("idhsdata", "idhs", var = var, ipums_domain = FALSE) diff --git a/README.Rmd b/README.Rmd index 94b03be6..7de9e5c5 100644 --- a/README.Rmd +++ b/README.Rmd @@ -162,7 +162,7 @@ tbl_config <- list( "and Performance Monitoring for Action (PMA) surveys" ), read = checkmark(), - request = "", + request = "DHS only", metadata = "" ), list( diff --git a/README.md b/README.md index 38d999ae..7442a758 100644 --- a/README.md +++ b/README.md @@ -63,242 +63,408 @@ ipumsr supports different levels of functionality for each IPUMS project, as summarized in the table below. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + Data Type + Description + Read Data Extracts + Request & Download Data + Browse Metadata
+ IPUMS USA logo + IPUMS USA + Microdata + U.S. Census and American Community Survey microdata (1850-present) + Check mark + Check mark +
+ IPUMS CPS logo + IPUMS CPS + Microdata + Current Population Survey microdata including basic monthly surveys and supplements (1962-present) + Check mark + Check mark +
+ IPUMS International logo + IPUMS International + Microdata + Census microdata covering over 100 countries, contemporary and historical + Check mark + Check mark +
+ IPUMS NHGIS logo + IPUMS NHGIS + Aggregate Data + Tabular U.S. Census data and GIS mapping files (1790-present) + Check mark + Check mark + Check mark
+ IPUMS IHGIS logo + IPUMS IHGIS + Aggregate Data + Tabular and GIS data from population, housing, and agricultural censuses around the world + Check mark + Check mark + Check mark
+ IPUMS Time Use logo + IPUMS Time Use + Microdata + Time use microdata from the U.S. (1930-present) and thirteen other countries (1965-present) + Check mark + Check mark +
+ IPUMS Health Surveys logo + IPUMS Health Surveys + Microdata + Microdata from the U.S. National Health Interview Survey (NHIS) (1963-present) and Medical Expenditure Panel Survey (MEPS) (1996-present) + Check mark + Check mark +
+ IPUMS Global Health logo + IPUMS Global Health + Microdata + Health survey microdata for low- and middle-income countries, including harmonized data collections for Demographic and Health Surveys (DHS) and Performance Monitoring for Action (PMA) surveys + Check mark + +DHS only +
+ IPUMS Higher Ed logo + IPUMS Higher Ed + Microdata + Survey microdata on the science and engineering workforce in the U.S. from 1993 to 2013 + Check mark + +
ipumsr uses the [IPUMS API](https://developer.ipums.org/) to submit data diff --git a/tests/testthat/helper_api.R b/tests/testthat/helper_api.R index 53d244b6..c089db20 100644 --- a/tests/testthat/helper_api.R +++ b/tests/testthat/helper_api.R @@ -160,6 +160,19 @@ test_meps_extract <- function() { ) } +test_dhs_extract <- function() { + define_extract_micro( + collection = "dhs", + description = "Test DHS extract", + samples = c("gh2003ir", "mz2011ir"), + variables = list( + "AGE", + "SEX" + ), + data_format = "fixed_width" + ) +} + test_nhgis_extract <- function() { define_extract_agg( "nhgis", diff --git a/tests/testthat/test_api_helpers.R b/tests/testthat/test_api_helpers.R index 5dd4a6d1..034e441a 100644 --- a/tests/testthat/test_api_helpers.R +++ b/tests/testthat/test_api_helpers.R @@ -434,7 +434,7 @@ test_that("We can get correct API version info for each collection", { has_support$code_for_api, c( "usa", "cps", "ipumsi", "nhgis", "ihgis", - "atus", "ahtus", "mtus", "nhis", "meps" + "atus", "ahtus", "mtus", "nhis", "meps", "dhs" ) ) expect_equal(ipums_api_version(), 2) diff --git a/vignettes/ipums-api-micro.Rmd b/vignettes/ipums-api-micro.Rmd index a5fac822..d85c0a73 100644 --- a/vignettes/ipums-api-micro.Rmd +++ b/vignettes/ipums-api-micro.Rmd @@ -63,6 +63,8 @@ API (shown with the codes used to refer to them in ipumsr): * IPUMS Health Surveys * IPUMS NHIS (`"nhis"`) * IPUMS MEPS (`"meps"`) +* IPUMS Global Health + * IPUMS DHS (`"dhs"`) API support will continue to be added for more collections in the future. See the [API documentation](https://developer.ipums.org/docs/apiprogram/) diff --git a/vignettes/ipums-api.Rmd b/vignettes/ipums-api.Rmd index 07e8bd12..2ebf7e4b 100644 --- a/vignettes/ipums-api.Rmd +++ b/vignettes/ipums-api.Rmd @@ -110,6 +110,7 @@ following collections: * IPUMS International * IPUMS Time Use (ATUS, AHTUS, MTUS) * IPUMS Health Surveys (NHIS, MEPS) + * IPUMS DHS - IPUMS aggregate data collections * IPUMS NHGIS diff --git a/vignettes/ipums.Rmd b/vignettes/ipums.Rmd index 65e7da15..a3c00a22 100644 --- a/vignettes/ipums.Rmd +++ b/vignettes/ipums.Rmd @@ -113,6 +113,7 @@ for the following collections: * IPUMS International * IPUMS Time Use (ATUS, AHTUS, MTUS) * IPUMS Health Surveys (NHIS, MEPS) + * IPUMS DHS - IPUMS aggregate data collections * IPUMS NHGIS * IPUMS IHGIS