All Questions
30
questions
2
votes
1
answer
90
views
sf methods to delineate a centerline from a channel
I am hoping to use Voronoi method to delineate a river channel centerline. I came across multiple sources but failed to replicate the work due to retired pacakges (rgeos).
i.e. https://gist.github.com/...
0
votes
1
answer
293
views
Creating a Sample of Random Points with an output of LAT/LON
I'm doing an analysis and want to create a random sample of points within a polygon and then extract the Lat/LON of those points so I can use another package with them.
So far I've been able to create ...
1
vote
1
answer
79
views
Is there a way to use one border for each created group in tmap R?
I'm trying to replicate this map:
Unfortunately there aren't any available shapefiles for those regions, but I do know the provinces in each group.
When I run this code, I get:
x <- c("ggmap&...
0
votes
0
answers
77
views
Seeing closest Origin & Destination with st_distance
I'm doing an analysis where I want to see which of the hospitals in my dataset is closet to the nearest nursing home. So for each nursing home I my goal is to find the hospital within the shortest ...
3
votes
1
answer
216
views
parallel computation with furrr on sf objects : future_map and map don't handle sf object the same way
I'm working on a sf points object.
I wrote a code to do some grouping and computing mean distance to the nearest neighbor and count by cities.
When I do all the processus with dplyr and purrr, it's ...
0
votes
1
answer
196
views
How to correctly use st_difference() in combination with mutate()?
I have a simple feature dataset with lines, and I am trying to find the parts of the lines that are more than 30m away from their respective Endpoints with the sf package and R. This is what I tried ...
0
votes
0
answers
231
views
Tigris error extracting county data using counties()
I am suddenly getting an error messaging when using tigris::counties() even though the same code worked perfectly fine a few weeks ago. Can anyone replicate this error or know of a workaround?
require(...
1
vote
1
answer
585
views
Temporarily drop sf object geometry and restore it after dplyr manipulation without losing point geometry
I've sf point data for buildings with the following properties:
class(df)
"sf" "grouped_df" "tbl_df" "tbl" "data.frame"
I used st_drop_geometry ...
2
votes
0
answers
462
views
Merge adjacent polygons in sf
I'm trying to merge groups of adjacent polygons, but I'm getting big multipolygons with non-adjacent areas. In the code block below plot(Matsuyama.sf) shows a large contiguous region and a few islands,...
9
votes
1
answer
303
views
Making a diagram map in r?
This is my dataframe:
df:
Country Total lon lat
United Kingdom 5000 -3.43597 55.37805
China 4000 104.1954 35.86166
France 4000 2....
1
vote
1
answer
99
views
Binding several sf together only plots first layer
I'm trying to create a script to generate generic maps with bathymetry, and I'm struggling to get it to work.
My issue is that depending on the map I want to make, I will call different bathymetric ...
2
votes
1
answer
447
views
Create Polygons by Category in sf file R
I have a large set of coordinates from the critical and endangered habit federal registry. I'm trying to digitize these maps for analysis. Here's a sample of the data as an example.
library(tidyverse)
...
0
votes
2
answers
377
views
How to properly plot sf object
I have data like the following:
These data are obtained from a Stata dataset (.dta exported to .csv) and are intended to plot a map of shapefiles. I import it into R, drop rows with missing data, and ...
1
vote
0
answers
609
views
Is there a way to combine two stars object containing the same variable sets at different locations in r
I'm trying to combine different raster data sets at different locations into one raster object. I just found the stars package in r that may potentially do this, and I like this package a lot because ...
0
votes
0
answers
195
views
How to visualize a layer onto a map with R?
I am trying to produce a map which would visualize the lu_effic on my map. With the current codes I can visualize the map and the lu_effic category, but they are not layered on each other. I would ...