18/11, 2021
devtools::install_github("Sustainscapes/GeoStratR")
or
remotes::install_github("Sustainscapes/GeoStratR")
data(Bios)
Select <- Stratify(Bios, LowGroup = 2, HighGroup = 10, Criterion = "calinski")
ggplot(Select$Results, aes(x = n_groups, y = calinski)) + geom_path() + geom_point() + theme_bw() + geom_hline(aes(yintercept = max(calinski)), lty = 2)
set.seed(2021) Points <- Random_Stratified_Min_Dist(ClassRaster = Select$FinalStack, MinDist = 2000, # in meters n = 30, n_to_test = 100)
head(Points)
## Simple feature collection with 6 features and 2 fields ## Geometry type: POINT ## Dimension: XY ## Bounding box: xmin: 10.10417 ymin: 55.10417 xmax: 10.39583 ymax: 57.35417 ## CRS: +proj=longlat +datum=WGS84 +no_defs ## # A tibble: 6 × 3 ## ID Class geometry ## <chr> <chr> <POINT [°]> ## 1 A01 A (10.10417 57.14583) ## 2 A02 A (10.27083 57.35417) ## 3 A03 A (10.35417 55.22917) ## 4 A04 A (10.3125 55.10417) ## 5 A05 A (10.39583 55.10417) ## 6 A06 A (10.39583 57.35417)
Export_Points(Points, name = "Selected", format = "GPX")