Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 71247

Use this tag when asking questions about the R package sf (Simple Features for R)

1 vote
1 answer
187 views

How to count the proportion of points in protected areas shape file using R packages?

I'm downloading the protected areas using the wdpar package which uses sf to deal with spatial data. … # load packages library(wdpar) library(dplyr) library(ggmap) library(sf) # download protected area data # (excluding areas represented as point localities) sa_raw_pa_data <- wdpa_fetch(c("South Africa …
adkane's user avatar
  • 341
2 votes
1 answer
606 views

Why does the area of overlap with st_intersection not match my expectation?

Here's my code: # load packages library(tidyverse) library(amt) library(sf) library(spex) #' load in the protected areas merged_Africa = read_sf("shape//eswatini//WDPA_Apr2020_SWZ-shapefile-polygons.shp …
adkane's user avatar
  • 341
1 vote
1 answer
281 views

Dissolving large shapefiles of protected areas in R

For this code to run you'll need to download the zip from protected planet and extract the three individual files for either UK or Ireland. library(sf) library(tidyverse) spath <- "data" (shps <- list.files …
adkane's user avatar
  • 341
1 vote
0 answers
134 views

Discrepancies in size of area for Brownian bridge model

You can see that when combined the area for D8 is around 30km2 but is ~21km2 when modelled alone. library(move) library(sf) library(amt) muleys <- read.csv( "https://raw.githubusercontent.com/walterASEL …
adkane's user avatar
  • 341
1 vote
2 answers
809 views

How to work with an ESRI projection in R using sf?

E.g. in the following simple code, it'd be handy to plug in 102022 in place of 4326. library(sf) library(spData) Kenya <- world[world$name_long == "Kenya", 0] rpoints <- st_sample(Kenya, size = 100, type …
adkane's user avatar
  • 341
3 votes
1 answer
2k views

Measuring percentage overlap between home ranges and another shape file in R

I have tracking data from multiple animals and I have created kernel density estimates of their home ranges. I want to find out the proportion of each home range area that falls within protected areas …
adkane's user avatar
  • 341
2 votes
1 answer
2k views

Extracting the attributes of one shapefile from the overlap of another using sf

I'm using R and the sf package. … Here's my code: #' load packages library(tidyverse) library(move) library(sf) library(amt) #' create a move object loc <- move( x = track$x_, y = track$y_, time = track$t_, proj = …
adkane's user avatar
  • 341
0 votes
Accepted

Extracting the attributes of one shapefile from the overlap of another using sf

The comment put me on the right track. This worked for me: ID1_parks <- st_intersection(hr_isopleths(dbbmm$ID1, level = 0.95),merged_Africa_tranform) And then I can extract the names etc. of the vari …
adkane's user avatar
  • 341
1 vote
0 answers
422 views

Get overlapping area between polygons by group rather than total area using the sf package i...

Full code and data below: #' load packages library(tidyverse) library(move) library(sf) library(amt) #' create a move object loc <- move( x = track$ …
adkane's user avatar
  • 341