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

Conflicting variable labels when using keep_geo_vars = T #582

Open
cottierf opened this issue Aug 20, 2024 · 0 comments
Open

Conflicting variable labels when using keep_geo_vars = T #582

cottierf opened this issue Aug 20, 2024 · 0 comments

Comments

@cottierf
Copy link

cottierf commented Aug 20, 2024

Hi,

Thanks for outstanding piece of software.

One issue, albeit minor, I noted is when requesting additional geography variables provided by Tigris using the option keep_geo_vars, there is variable labels conflict in the resulting dataset.

In effect, the output dataset contains two "NAME" variables: [NAME.x] and [NAME.y]. The content of these two variables vary depending on the geography level, but [NAME.y] is generally more complete. Would it be possible to solve this issue, by either reconciling the labels or dropping one of the two variables?

minimal example:

library(tidycensus)
library(tigris)

data <- tidycensus::get_decennial(
  geography = "tract",
  state = "AL",
  variables =  "P1_001N",
  year = 2020,
  geometry = T,
  keep_geo_vars = T, output = "wide"
)

data
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

No branches or pull requests

1 participant