View source: R/create_training_data.R
create_training_data_from_polygons | R Documentation |
Given an input dataset and set of polygons indicating a class, sample points from inside and outside polygons and extract predictor values for positive and negative points.
create_training_data_from_polygons(
polygons,
predictors_raster,
analysis_region,
sample_rate = 0.5,
region_margin = 50,
polygon_class = "positive",
nonpolygon_class = "negative"
)
polygons |
SpatVector of polygons indicating all locations belonging to the class you wish to predict |
predictors_raster |
SpatRaster with a layer for each predictor variable |
analysis_region |
polygon or raster indicating the extent from which points can be sampled. Only regions covered by non-NA cells will be included if analysis_region is a raster. |
sample_rate |
Samples per km^2 |
region_margin |
width in meters of margin to draw around polygon edges which will not be used for sampling. |
polygon_class |
string to use for class attribute for points sampled from inside polygons |
nonpolygon_class |
string to use for class attribute for points sampled outside polygons |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.