Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code and documentation in R folder to incorporate 2020 Census data #47

Merged
merged 19 commits into from
Feb 14, 2022

Conversation

xiyuy98
Copy link

@xiyuy98 xiyuy98 commented Jan 23, 2022

Update functions and their documentations to incorporate 2020 Census data as part of the package.

Copy and paste the voters.RData from master branch. Delete the original voters.RData file in hwru branch.
Add stringr, dplyr, Rcpp to the Imports field of DESCRIPTION file. Add import(dplyr) in the NAMESPACE file.
Add default values to the arguments of merge_names function. Comment out the line of code require(dplyr).
Add a new argument year; Modify the parts of code with arguments age and sex equal to False; Substitute all 2010 census data links with variable census_data_url.
Add a new argument, year = "2010", to the get_census_data function.
Add argument year = "2010"; Update the part calculating probability Pr(Race|Geo).
Keep year argument; Drop two arguments age and sex.
Add year argument to census_helper.R.
Add a year argument; Add a warning saying that predictions other than having both age and sex equal to FALSE are not supported with 2020 census data.
Update the function description, parameter description of year, and add one more example.
Add description of parameter year and one more example with year equal to 2020.
Code
1. If census.data is provided, ensure that its elements sex and age are FALSE.
Documentation
1. Add place as a geolocation level to function description and parameter description of geo.
2. Revise parameter description for census.data (both elements sex and age must be FALSE; year element of census.data must corresponds to the value of the year argument in the function).
3. Revise all examples from census_helper to census_helper_new.
4. Add one more example with year equal to "2020".
1. Add place as a geolocation level to function description and parameter description of geo.
2. Add parameter description for year.
3. Revise parameter description for census.data (year element of census.data must corresponds to the value of the year argument).
4. Add one more example with year equal to "2020".
Add a year argument to function predict_race_new.
Based on line 156 (surname.year %in% c(2000, 2010, 2021)), there are three available values for surname.year. The documentations of parameters census.surname, surname.year, and census.geo need to be revised to reflect the new value option 2021.
1. Revise the description for census.surname to include the 2021 Surname List.
2. Revise the description for surname.year to include the 2021 Surname List.
3. Revise the description for census.geo to not specify the year of the Census geogrphic data.
4. Add parameter description for year.
5. Add one more example for the function.
Take out the references to "USCensus2010" in the function description.
1. Add the description of use.census.surnames.
2. Add the description of census.surnames.
1. Revise the description of census.geo so as to not specify the year of the Census geographic data.
2. Add the description of census.surnames.
3. Add the description of year.
4. Change the function name of all examples from predict_race to predict_race_new.
5. Delete, modify and add examples to reflect the functionality of predict_race_new.
1. Modify the census_geo_api fucntion description.
2. Modify lines 23 & 34 of predict_race function so that the year of the Surname list should be 2020 instead of 2021.
3. Modify lines 156-157 of predict_race function to change the option 2021 to 2020 for surname.year.
4. Small revision for the census.surnames description in function predict_race_new.
@solivella solivella merged commit a8050cc into hwru Feb 14, 2022
@solivella solivella deleted the census2020-xiyu branch June 3, 2022 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants