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
Hi,
Seens like the sp package changed the function as(obj, "Spatial"). Now, the synthax is as_Spatial(obj).
sp
as_Spatial(obj)
I will be glad if you fix the function!
=]
Current code: if (class == "SpatialPolygonsDataFrame") brmap <- as(brmap, "Spatial") if (class == "data.frame") brmap <- as(brmap, "Spatial") %>% ggplot2::fortify(region = geo)
if (class == "SpatialPolygonsDataFrame") brmap <- as(brmap, "Spatial") if (class == "data.frame") brmap <- as(brmap, "Spatial") %>% ggplot2::fortify(region = geo)
New code: if (class == "SpatialPolygonsDataFrame") brmap <- sf::as_Spatial(brmap) if (class == "data.frame") brmap <- sf::as_Spatial(brmap) %>% ggplot2::fortify(region = geo)
if (class == "SpatialPolygonsDataFrame") brmap <- sf::as_Spatial(brmap) if (class == "data.frame") brmap <- sf::as_Spatial(brmap) %>% ggplot2::fortify(region = geo)
The text was updated successfully, but these errors were encountered:
I believe this is a consequence of the sf package function change, but prior to calling get_brmap make sure you load the package sf.
library(brazilmaps) library(sf) map_states <- get_brmap(geo = "State", class = "sf") plot_brmap(map_states)
It would be best if this is fixed in the package as above to help users
Sorry, something went wrong.
No branches or pull requests
Hi,
Seens like the
sp
package changed the function as(obj, "Spatial"). Now, the synthax isas_Spatial(obj)
.I will be glad if you fix the function!
=]
Current code:
if (class == "SpatialPolygonsDataFrame") brmap <- as(brmap, "Spatial") if (class == "data.frame") brmap <- as(brmap, "Spatial") %>% ggplot2::fortify(region = geo)
New code:
if (class == "SpatialPolygonsDataFrame") brmap <- sf::as_Spatial(brmap) if (class == "data.frame") brmap <- sf::as_Spatial(brmap) %>% ggplot2::fortify(region = geo)
The text was updated successfully, but these errors were encountered: