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

Issue with plotting maps that include Connecticut #88

Closed
jerryli822 opened this issue Feb 17, 2024 · 2 comments · Fixed by #94
Closed

Issue with plotting maps that include Connecticut #88

jerryli822 opened this issue Feb 17, 2024 · 2 comments · Fixed by #94
Assignees
Labels
bug A bug or issue that should be resolved
Milestone

Comments

@jerryli822
Copy link

Describe the bug
When using the plot_usmap function with any dataset that includes Connecticut, the area for Connecticut appears as blank.

To Reproduce
Using your example:

"library(ggplot2)

mt <- plot_usmap("states", include = .mountain, labels = TRUE)

fl <- plot_usmap("counties", data = countypov, values = "pct_pov_2014", include = "FL") +
scale_fill_continuous(low = "green", high = "red", guide = "none")

ne <- plot_usmap("counties", data = countypop, values = "pop_2015", include = .new_england) +
scale_fill_continuous(low = "blue", high = "yellow", guide = "none")

cowplot::plot_grid(mt, fl, ne, nrow = 1)"

----> Connecticut on the third map is completely dark (N/A).

@jerryli822 jerryli822 added the bug A bug or issue that should be resolved label Feb 17, 2024
@pdil
Copy link
Owner

pdil commented Feb 28, 2024

Yes, as of the 2022 shapefiles Connecticut counties have different FIPS codes (more info here: https://www.federalregister.gov/documents/2020/12/14/2020-27459/change-to-county-equivalents-in-the-state-of-connecticut). As such any datasets that use the old codes won't map correctly to the counties. Thank you for the report though, this is a good reminder to update the included datasets in this package as they are now quite old.

@pdil pdil self-assigned this Feb 28, 2024
@pdil pdil added this to the v0.8.0 milestone Feb 28, 2024
@pdil
Copy link
Owner

pdil commented Mar 14, 2024

The most recent poverty data set is from 2021 so it doesn't include the Connecticut changes yet. In the next usmap update you'll be able to see Connecticut counties plot correctly with the countypop data set but not countypov yet. Maybe this year there will be a new update which I can include when it's available.

@pdil pdil closed this as completed in #94 Mar 14, 2024
pdil added a commit that referenced this issue Mar 14, 2024
* Updated included county and state population and poverty data sets.
* Added snapshot tests for said data sets.

resolves #88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug or issue that should be resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants