We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Nice package! It would be great if there was an easy way convert a recmap object to an sf object to make it easier to visualize outside of plot()
plot()
The text was updated successfully, but these errors were encountered:
@cpsievert I wonder if the as.SpatialPolygonsDataFrame function could help you for the moment.
as.SpatialPolygonsDataFrame
library(recmap) SpDf <- as.SpatialPolygonsDataFrame(recmap(checkerboard(8))) ## US example usa <- data.frame(x = state.center$x, y = state.center$y, # make the rectangles overlapping by correcting # lines of longitude distance. dx = sqrt(state.area) / 2 / (0.8 * 60 * cos(state.center$y * pi / 180)), dy = sqrt(state.area) / 2 / (0.8 * 60), z = sqrt(state.area), name = state.name) usa$z <- state.x77[, 'Population'] US.Map <- usa[match(usa$name, c('Hawaii', 'Alaska'), nomatch = 0) == 0, ] as.SpatialPolygonsDataFrame(recmap(US.Map))
Sorry, something went wrong.
@cpsievert Seems to work. Is that what you want?
library(sf) SPDF <- as.SpatialPolygonsDataFrame(recmap(US.Map)) st_as_sf(SPDF)
Ahh, yes, that's works for me, thanks!
cpanse
No branches or pull requests
Nice package! It would be great if there was an easy way convert a recmap object to an sf object to make it easier to visualize outside of
plot()
The text was updated successfully, but these errors were encountered: