Skip to content

Commit

Permalink
updating R scripts for paper 2 task 1
Browse files Browse the repository at this point in the history
  • Loading branch information
coreytcallaghan committed Nov 8, 2024
1 parent cc2ae9a commit 7e6b621
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ for (i in 1:length(buffers)) {
st_write(buffers[[i]], filename, driver = "GeoJSON", delete_dsn = TRUE)
}

st_as_text(st_read("Data/GBIF data for potential study sites/buffer_1.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for potential study sites/buffer_2.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for potential study sites/buffer_3.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for potential study sites/buffer_4.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for potential study sites/buffer_5.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for test cases/buffer_1.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for test cases/buffer_2.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for test cases/buffer_3.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for test cases/buffer_4.geojson")$geometry)
st_as_text(st_read("Data/GBIF data for test cases/buffer_5.geojson")$geometry)

17 changes: 17 additions & 0 deletions Code/XX_sample_50_km_buffer_and_make_grids.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# script to randomly sample regions of the 50 km buffers


# packages
library(sf)
library(tidyverse)
library(ggplot2)


# read in GBIF data
# only for one buffer for now
gbif_dat <- read_delim("Data/GBIF data for test cases/buffer_1_data/occurrence.txt")

# read in buffer geojson
buffer_spatial <- st_read("Data/GBIF data for test cases/buffer_1.geojson")

plot(buffer_spatial)

0 comments on commit 7e6b621

Please sign in to comment.