diff --git a/DESCRIPTION b/DESCRIPTION index 7933cfe..b381b5e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ccesMRPprep Type: Package Title: Functions and Data to Prepare CCES data for MRP -Version: 0.1.11.9999 +Version: 0.1.12 Authors@R: c(person(given = "Shiro", family = "Kuriwaki", @@ -33,7 +33,7 @@ Imports: dataverse (>= 0.3.0), tidycensus (>= 0.11.4), furrr -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Language: en-US Roxygen: list(markdown = TRUE) License: MIT + file LICENSE diff --git a/NEWS.md b/NEWS.md index d778e0b..4e14968 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ + +# cccesMRPprep 0.1.12 + +* Add 2021, 2022, and 2023 to cces_dv_ids +* Add 2022 validated vote and 2023 cumulative name update to cces_dv_ids + # ccesMRPprep 0.1.11 * Add CD-level analyses diff --git a/R/get_dataverse.R b/R/get_dataverse.R index c021fa3..ea84c8a 100644 --- a/R/get_dataverse.R +++ b/R/get_dataverse.R @@ -58,7 +58,7 @@ #' #' get_cces_dataverse <- function(name = "cumulative", - year_subset = 2006:2020, + year_subset = NULL, std_index = TRUE, dataverse_paths = ccesMRPprep::cces_dv_ids) { @@ -79,7 +79,7 @@ get_cces_dataverse <- function(name = "cumulative", if (filetype == ".tab" | filetype == ".dta") fun <- haven::read_dta - if (filetype == ".dta" & isTRUE(yr == 2009)) + if (filetype == ".dta" & (yr %in% c(2009, 2022))) fun <- function(x) haven::read_dta(x, encoding = "latin1") if (filetype == ".sav") @@ -96,7 +96,7 @@ get_cces_dataverse <- function(name = "cumulative", .f = fun) # subset --- - if (name == "cumulative") { + if (name == "cumulative" & !is.null(year_subset)) { cces_raw <- filter(cces_raw, .data$year %in% year_subset) } diff --git a/README.Rmd b/README.Rmd index 7bf7494..68fe580 100644 --- a/README.Rmd +++ b/README.Rmd @@ -4,7 +4,7 @@ output: github_document --- -[![tic](https://github.com/kuriwaki/ccesMRPprep/workflows/tic/badge.svg?branch=main)](https://github.com/kuriwaki/ccesMRPprep/actions) +[![check-standard](https://github.com/kuriwaki/ccesMRPprep/actions/workflows/check-standard.yml/badge.svg)](https://github.com/kuriwaki/ccesMRPprep/actions/workflows/check-standard.yml) ```{r setup, include=FALSE} diff --git a/README.md b/README.md index 2471851..14a9844 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Portable Routines for Preparing CCES and ACS data for MRP -[![tic](https://github.com/kuriwaki/ccesMRPprep/workflows/tic/badge.svg?branch=main)](https://github.com/kuriwaki/ccesMRPprep/actions) +[![check-standard](https://github.com/kuriwaki/ccesMRPprep/actions/workflows/check-standard.yml/badge.svg)](https://github.com/kuriwaki/ccesMRPprep/actions/workflows/check-standard.yml) Cite as: diff --git a/data-raw/create_dataverse-ids.R b/data-raw/create_dataverse-ids.R index 8ecaed2..2dc6a3f 100644 --- a/data-raw/create_dataverse-ids.R +++ b/data-raw/create_dataverse-ids.R @@ -2,7 +2,7 @@ library(tibble) cces_dv_ids <- tribble( ~cces_name, ~year, ~doi, ~filename, ~caseid_var, ~server, - "cumulative", NA, "10.7910/DVN/II2DB6", "cumulative_2006-2021.dta", "case_id", "dataverse.harvard.edu", + "cumulative", NA, "10.7910/DVN/II2DB6", "cumulative_2006-2023.dta", "case_id", "dataverse.harvard.edu", "2006", 2006, "10.7910/DVN/Q8HC9N", "cces_2006_common.tab", "v1000", "dataverse.harvard.edu", "2007", 2007, "10.7910/DVN/OOXTJ5", "CCES07_OUTPUT.sav", "caseid", "dataverse.harvard.edu", "2008", 2008, "10.7910/DVN/YUYIVB", "cces_2008_common.tab", "V100", "dataverse.harvard.edu", @@ -18,6 +18,9 @@ cces_dv_ids <- tribble( "2018", 2018, "10.7910/DVN/ZSBZ7K", "cces18_common_vv.dta", "caseid", "dataverse.harvard.edu", "2019", 2019, "10.7910/DVN/WOT7O8", "CCES19_Common_OUTPUT.tab", "caseid", "dataverse.harvard.edu", "2020", 2020, "10.7910/DVN/E9N6PH", "CES20_Common_OUTPUT_vv.dta", "caseid", "dataverse.harvard.edu", + "2021", 2021, "10.7910/DVN/OPQOCU", "CES21_Common_OUTPUT.tab", "caseid", "dataverse.harvard.edu", + "2022", 2022, "10.7910/DVN/PR4L8P", "CCES22_Common_OUTPUT_vv_topost.dta", "caseid", "dataverse.harvard.edu", + "2023", 2023, "10.7910/DVN/JQJTCC", "CCES23_Common_OUTPUT.tab", "caseid", "dataverse.harvard.edu", ) diff --git a/data/cces_dv_ids.rda b/data/cces_dv_ids.rda index ec9cf99..601742a 100644 Binary files a/data/cces_dv_ids.rda and b/data/cces_dv_ids.rda differ diff --git a/man/get_cces_dataverse.Rd b/man/get_cces_dataverse.Rd index dc1b549..59e7066 100644 --- a/man/get_cces_dataverse.Rd +++ b/man/get_cces_dataverse.Rd @@ -6,7 +6,7 @@ \usage{ get_cces_dataverse( name = "cumulative", - year_subset = 2006:2020, + year_subset = NULL, std_index = TRUE, dataverse_paths = ccesMRPprep::cces_dv_ids )