prepare.vector.data {spectralR} | R Documentation |
Prepare vector data for further reflectance data sampling
Description
The function takes shapefile with polygons of different surface classes (habitats, crops, vegetation, etc.), and retrieves ready-for-sampling sf object.
Usage
prepare.vector.data(shapefile_name, label_field)
Arguments
shapefile_name |
shapefile name (should be within working directory, using absolute paths were not tested) |
label_field |
name of the field which contains class labels |
Value
sf object with label (characters) and class (integer) variables, as well as geometry of each polygon, ready to further processing by rgee.
Examples
# Load example data
load(system.file("testdata/reflectance_test_data.RData", package = "spectralR"))
# Prepare vector data
sf_df <- prepare.vector.data(
shapefile_name = system.file("extdata/test_shapefile.shp", package = "spectralR"),
label_field = "veget_type")
head(sf_df)
[Package spectralR version 0.1.3 Index]