All Questions
67
questions
0
votes
1
answer
74
views
I need spatial polygons representing the land and sea in a world map and then convert them to a dataframe
I need a world map in R that can be transformed into polygons of land to be able to calculate distances through sea from one point to another and going around land/polygons. These polygons need to be ...
1
vote
3
answers
67
views
Customize malaria atlas project autoplots
I am trying to plot some data from the Malaria Atlas Project. Therefore, I looked in the vignette and used an example for getting started:
if (!require("malariaAtlas")) install.packages(&...
1
vote
1
answer
81
views
adehabitatHR KUD loop not overlaying mapping correctly in R
I have some code which calculates KUD at 95% from fish position data, restricted by the bounds of a shapefile, and then plots this, and overlays the shapefile on top.
########## BOUND KUD TO SHAPEFILE ...
0
votes
1
answer
56
views
Downloaded sf polygon data are not visible on plotted map
I´m trying to create a range map in R, which is supposed to show the occurrences of a specific tree species (Quercus cerris) in the world. For this, I use the BIEN database and the function ...
0
votes
0
answers
50
views
Editing the legend of a ggplot2 map
I created a ggplot2 map, but I'm having trouble putting the geom_points, where they appear within each region coloring, but they should appear separating indicating "city" and "station&...
2
votes
1
answer
183
views
R plotly duplicated values as text in add_sf for customised maps
I am plotting customised maps with plotly using add_sf with a sf object. Here is the structure of the sf object (CdE_Aff2), with 53 polygons (or observations). I do not know how to produce a "...
0
votes
1
answer
114
views
R Make choropleth map with Robinson projection
I'm trying to make a choropleth map with a Robinson projection, mapping means onto each country. But something in the projection goes very wrong.
Here's a reproducible example and excerpts of full ...
1
vote
0
answers
88
views
Identify and plot differences between two shapefiles using sf and ggplot2
I have two shapefiles that show old and new municipality borders. Some municipalities were combined, others were divided.
I would like to show the differences between the two, that is, which ...
0
votes
1
answer
288
views
I would like to add the borders of municipalities to map of Brazil. How can I achieve this using the ggplot, sf and brazilmaps packages?
I am currently working on a map visualization in R using the ggplot. brazilmaps and the sf packages. I have successfully plotted the municipalities of a certain region, filling them with the color &...
0
votes
1
answer
155
views
How can I color the border line differently between two points on a map made with geom_sf and ggplot2?
Recently, I have posted a similar question here and I received the following answer,
library(sf)
library(ggplot2)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
rect ...
1
vote
2
answers
79
views
Why is there a small part of the distribution map on the right side and how do I fix it using sf package in R?
I am trying to create a distribution map on North America. But a small part of the map is on the right side of the plot. The result is like in the screenshot.
Screenshot of the map:
I tried it with ...
0
votes
2
answers
188
views
Adjust value of sfc_POINT in R
For the U.S., I can get the centroids of all the counties in a state. However, upon closer inspection, the centroid of some counties is not correct. How can I manually correct the point geometry (...
0
votes
2
answers
934
views
Extract centroid latitude and longitude for each county in the U.S. using R
How can I get a data frame listing each state and county in the U.S. along with the latitude and longitude of the center of each county?
A version of this question has been asked many times over the ...
1
vote
1
answer
438
views
ggplot and maps: problem with filtering country names
I try to create a map of the Middle East and North Africa region including country names. The map is defined by latitude and longitude coordinates. Several non-MENA countries are included in the ...
1
vote
1
answer
265
views
Artefacts when using geom_sf and projection
I want to plot a simple world map with the mercator projection using geom_sf() in ggplot:
library(maps)
library(sf)
# Load world map and transform to Mercator projection
world1 <- sf::st_as_sf(map(...