Skip to contents

Export created points

Usage

Export_Points(Points, ID_Col = "ID", format = "SHP", name = "Samples")

Arguments

Points

The name of the SF file with the spatial points.

ID_Col

Name of the ID column, defaults to "ID".

format

a character, it can be SHP, GPX or RDS, default to "SHP".

name

The name of the file without the extension, defaults to "Samples".

Value

An exported SHP, GPX or RDS file

Examples

data(Bios)
library(terra)
#> terra 1.7.78
Bios <- terra::unwrap(Bios)

a <- Stratify(Bios)
#> Warning: Quick-TRANSfer stage steps exceeded maximum (= 178550)


plot(a$FinalStack, colNA = "black")


FinalRaster <- a$FinalStack

Points <- Random_Stratified_Min_Dist(ClassRaster = FinalRaster,
                                     MinDist = 2000,
                                     n = 30,
                                     n_to_test = 100)
#> Joining with `by = join_by(x, y)`

Export_Points(Points, name = "Selected")
# remove created files
file.remove(list.files(pattern = "Selected"))
#> [1] TRUE TRUE TRUE TRUE TRUE