Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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/...
Jane's user avatar
  • 614
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 ...
Blue_Wolverine's user avatar
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&...
almr27's user avatar
  • 43
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 ...
Blue_Wolverine's user avatar
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 ...
pgourdon's user avatar
  • 149
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 ...
Jelto's user avatar
  • 15
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(...
Quinterpret's user avatar
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 ...
Xaviermoros's user avatar
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,...
Mark R's user avatar
  • 907
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....
user avatar
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 ...
Fred-LM's user avatar
  • 320
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) ...
JulietheFoodie's user avatar
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 ...
bill999's user avatar
  • 2,443
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 ...
Miao  Cai's user avatar
  • 982
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 ...
Kibria's user avatar
  • 1

15 30 50 per page