kosukeimai / wru

Who Are You? Bayesian Prediction of Racial Category Using Surname and Geolocation
130 stars 30 forks source link

Unable to use custom geographies #42

Closed aridf closed 2 years ago

aridf commented 3 years ago

Perhaps I am misunderstanding the docs here. The description of the census.geo argument indicates it is optional, and that users can instead pass in a census.data object so the census API need not be called. However, it seems the census.geo option is not optional in the function definition (it has no default value), and the source code also indicates that the predict_race function will stop if no valid value for census.geo is passed. Is there actually a way to input custom geographic information here?

1beb commented 2 years ago

census.geo is currently not optional. There is no way to specify a custom census.geo presently, although it might be possible to allow for a "passthrough" of a specific variable that is contained in both voter.file and census.data, if that's what you were thinking. Adding a census geography is trivial but time consuming. Currently supported are: county, tract, block group (in hwru branch), block and place. If you have a psuedo-reprex (an example of input/output) I can put some thought into it.