fiftystater | Easy 50 state maps for R & ggplot2 | Data Visualization library
kandi X-RAY | fiftystater Summary
kandi X-RAY | fiftystater Summary
🗺Easy 50 state maps for R & ggplot2
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fiftystater
fiftystater Key Features
fiftystater Examples and Code Snippets
Community Discussions
Trending Discussions on fiftystater
QUESTION
I would like to create a map of the US showing both state and county boundaries (i.e. state boundaries in a different color). I typically do this using either shape files that I import or using ggplot2
's map_data
function. However, I face three obstacles.
1) I cannot install gdal
and geos
in my computing environment so that precludes the use of any shape files or GeoJSON files (my attempts to map county level shape files loaded using fastshp
have not been successful but I'm open to any solution that can reproduce the map below but with state boundaries included).
2) I need to include Hawaii and Alaska, so that excludes the use of map_data
from ggplot2
.
3) I need the map to include both state AND county boundaries, which makes the use of usmap
package problematic as its a wrapper function for ggplot2
but without the ease and general ability to customize to the level of a raw ggplot2 object.
4) Also, cannot make use of sf
package bc it has a non R library dependency (units
package depends on C library libudunits2
).
What I need: A map that can project Alaska and Hawaii and display state and county boundaries using contrasting colors and I need to accomplish all this without resorting to any packages that rely on rgeos
, rgdal
, and/or units
.
What I've tried thus far plot_usmap
from the usmap
package:
ANSWER
Answered 2020-Feb-05 at 23:31Ok after some suggestions from the package author and some of my own tinkering around I was finally able to get my desired output.
This approach is ideal for folks looking to generate a US map w/ Alaska and Hawaii included who...
1) Do not have the ability to install non-R packages in the environment their R engine is running on (e.g. lack admin access)
2) Need to map both county and state boundaries using contrasting colors
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fiftystater
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page