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

All Questions

Tagged with
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 ...
Iris Van Paemel's user avatar
0 votes
1 answer
78 views

'unable to find an inherited method for function ‘costDistance’ for signature' error while trying to do a friction weighted connectivity analysis

The purpose What I am trying to achieve: I am trying to calculate the friction weighted connectivity values of the polygons in a shapefile using a friction raster. The shapefiles symbolize habitats ...
Time_Bottle's user avatar
0 votes
1 answer
63 views

How to preserve holes when combining contours into polygons via R?

Part of the workflow for my project requires creating contours from a raster. I am able to generate the contours using raster::rasterToContour and can convert to a polygon using the sf package in R, ...
DDaye's user avatar
  • 15
0 votes
1 answer
108 views

Error with M values and st_zm function in sf package

I have imported a multipolygon shp file containing different forest patches (called 'patch'): patch Then, I have bricked different Sentinel-2 bands for the same region in a raster called 'SenBel' data:...
Max_student's user avatar
0 votes
2 answers
112 views

how to extract multiple polygon in r

Use this code below to give the mean of each district and this link CHIRPS tar.gz data, for precipitation data, library(geodata) for administrative districts. library(sf) library(raster) # library(...
Abby's user avatar
  • 1
0 votes
0 answers
84 views

Create non-circular buffer around points (Spatial R)

I have some data that exist in a waterway system river network, and I'm trying to draw a buffer around some points, to see which areas of the water lie within a 10km boat ride. library(raster) library(...
colebrookson's user avatar
3 votes
0 answers
292 views

Is it possible to create an irregular raster in R with terra package?

I have a dataset which represents a global grid with latitude and longitude and the length of each pixel along the x and y axis. These are simply lat/long CRS. Like this head(latlong) x y ...
Herman Toothrot's user avatar
0 votes
3 answers
94 views

Jaccard index: R not letting me convert raster to numeric?

I'm trying to calculate the Jaccard index for my data, which is for two presence/absence rasters (of two different species). I also have a third raster, that contains the overlap of the species ranges....
sirianmckellan's user avatar
1 vote
1 answer
1k views

How to extract the mean raster value for a polygon based on matching a layer from a raster stack in R

Apologies for my naivety (and general incompetence), first time asking a question here and I'm not particularly good at R. I have tried to provide a reproducible example below. I have a stack of 365 ...
DMAD Tim's user avatar
1 vote
0 answers
51 views

How can remove wrapline while buffering with sf package in r

How can I remove the crossing line while using the buffer code below. I tried to create buffers round some point locations and to have a union but ended up getting a crossline. Please see the codes ...
Ridwan Shittu's user avatar
1 vote
1 answer
775 views

How to find the area of intersections with raster/terra based methods and memory constraints in R?

I am trying to find the area of forest (conserved patches) around crop fields. For example, I would like to know the area of forest within a 500m or 5km radius from fields within a county. My data is ...
RobertoAS's user avatar
0 votes
1 answer
371 views

R stars::st_as_sf( , merge = TRUE) not working properly with Raster - Points with same values are not all merged

I have been trying to polygonize a raster in R and ran into memory issues. Searching for solutions, I found this question with a routine using the stars package in R that I felt could solve my issues. ...
RobertoAS's user avatar
0 votes
1 answer
384 views

Group raster files by week/month

I have downloaded AOD data ("MCD19A2") using the MODIStsp package for several years. library(raster) library(stars) The data I have extracted has the following format: ...
Berta_94's user avatar
2 votes
1 answer
312 views

Issue plotting generated polygon grid to leaflet

I am trying to create a polygon grid to plot in leaflet, but am running into an error that I cannot seem to figure out: library(leaflet) library(raster) library(sf) library(rgdal) r <- raster(ext =...
metamorporpoise's user avatar
0 votes
2 answers
676 views

exactextractr in R , Error: [names<-] incorrect number of names

Used exactextractr package (CRAN link) already and it always worked : I have a raster stack (s) and cut out with a shape-file (INV) like this df1 <- exact_extract(s, INV, fun = c("mean", &...
Wollbrecht's user avatar

15 30 50 per page