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

Bisg vignette #70

Merged
merged 31 commits into from
Aug 21, 2020
Merged

Bisg vignette #70

merged 31 commits into from
Aug 21, 2020

Conversation

jcburke
Copy link
Collaborator

@jcburke jcburke commented Aug 12, 2020

Perform BISG using the following functions:
dedupe_voter_file()
merge_shape_file()
wru_predict_race_wrapper()

The text needs to be updated though and re-edited for better display of possibly graphic information related to BISG, and overall a more concise walk-through.

The vignette also adds plots (barplot and choropleth maps for BISG race/ethnicity predictions)

@scottyhq
Copy link
Collaborator

@jcburke -looks like you need to fix a merge conflict again - I suggest trying the web editor in this case since there are just a few lines in bisg.Rmd to fix

@jcburke
Copy link
Collaborator Author

jcburke commented Aug 14, 2020

I realized this paragraph, needs the following changes:

  • "In R, the wru package - WRU: Who Are You performs BISG. "

  • "The first step in performing BISG is to geocode your voter file addresses. For information on geocoding, visit the eiCompare: Geocoding vignette"

  • "We will perform BISG using the previous Gwinnett and Fulton county voter registration data called ga_geo.csv."

Copy link
Collaborator

@pssachdeva pssachdeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good. I like the maps.

The header might need additional lines to ensure that CMD check runs the vignette. Once that happens, I think some of the code blocks might break since they're importing data on the Jupyter Hub.

I am planning on updating wru_predict_race_wrapper and precinct_agg_combine based on Loren's suggestions, which will probably impact a few lines in this vignette. I'll ping you when I send those PRs in.

vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
vignettes/bisg.Rmd Outdated Show resolved Hide resolved
Made corrections to BISG vignette introduction and added information stating that the tigris package is publicly accessible and can be used to load shape files.
Removed sourcing wru wrapper and voter_utils fuctions.
… and added tidy::extract to the BISG vignette
…out these lines of code to evaluate whether georgia_census.rda was loading and if it was causing an error for knitting/building the BISG vignette.
@jcburke jcburke requested a review from scottyhq August 20, 2020 23:32
@jcburke
Copy link
Collaborator Author

jcburke commented Aug 20, 2020

@scottyhq and @woodsp , I think the tigris package (for downloading shape files from the census) may be having trouble loading because the rgdal dependency is unable to load. So, it can't get the block shape files.

I tried to load the rgdal and tigris packages on my local and loading the block shape files worked. Any insight on how to remedy this? is it similar to the issue we are having with loading censusxy for the geocoding vignette?

@jcburke jcburke requested a review from woodsp August 21, 2020 00:14
@scottyhq
Copy link
Collaborator

@scottyhq and @woodsp , I think the tigris package (for downloading shape files from the census) may be having trouble loading because the rgdal dependency is unable to load. So, it can't get the block shape files.

I tried to load the rgdal and tigris packages on my local and loading the block shape files worked. Any insight on how to remedy this? is it similar to the issue we are having with loading censusxy for the geocoding vignette?

Yes, if possible (if the data files for the vignette are small) you can include them in the package and comment out the tigris API call to retrieve them in your vignette. Much like a cooking show... your commented code shows how it's done, but the retrieved product is there in case there are network issues

@jcburke
Copy link
Collaborator Author

jcburke commented Aug 21, 2020

@scottyhq and @woodsp , I think the tigris package (for downloading shape files from the census) may be having trouble loading because the rgdal dependency is unable to load. So, it can't get the block shape files.
I tried to load the rgdal and tigris packages on my local and loading the block shape files worked. Any insight on how to remedy this? is it similar to the issue we are having with loading censusxy for the geocoding vignette?

Yes, if possible (if the data files for the vignette are small) you can include them in the package and comment out the tigris API call to retrieve them in your vignette. Much like a cooking show... your commented code shows how it's done, but the retrieved product is there in case there are network issues

Okay, I am going to include a subsetted version of the shape file in the data folder for the package and instruct the user on how to load it using tigris with commented out code as an alternative as well. Thanks for your help!

…ck and tract information relative to the voter file tract and block information. The shape file is named gwin_fulton_shape.rda. I also created some alternative code that has been commented out for installing tigris and loading the shapefile using the tigris package.
Remove tidyverse
Copy link
Member

@woodsp woodsp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Checks are all passing on my machine too.

title: "Bayesian Improved Surname Geocoding (BISG)"
output: rmarkdown::html_document
vignette: >
%\VignetteIndexEntry{bisg}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed in the build that this entry should be "Bayesian Improved Surname Geocoding (BISG)" to display correctly with browseVignettes().

@jcburke jcburke merged commit d5be610 into master Aug 21, 2020
@jcburke jcburke deleted the bisg_vignette branch August 21, 2020 23:57
@jcburke jcburke restored the bisg_vignette branch August 21, 2020 23:57
@jcburke jcburke mentioned this pull request Aug 22, 2020
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.

None yet

4 participants