get_pixels: Extract observed data for use in a classification (training...

Description Usage Arguments Value

View source: R/pixel_data.R


Extract observed data for use in a classification (training or testing)


get_pixels(x, polys, class_col, training = 1, src = "none")



a Raster* object from which observed data will be extracted. The data will be extracted from each layer in a RasterBrick or RasterStack.


a SpatialPolygonsDataFrame with polygons, each of which has been assigned to a particular class (using the values in class_col)


the name of the column containing the response variable (for example the land cover type of each pixel)


indicator of which polygons to use in training. Can be: 1) a string giving the name of a column indicating whether each polygon is to be used in training (rows equal to 1) or in testing (rows equal to FALSE), or 2) a logical vector of length equal to length(polys), or 3) a number between 0 and 1 indicating the fraction of the polygons to be randomly selected for use in training.


name of this data source. Useful when gathering training data from multiple images.


a link{pixel_data} object will contain the the @examples set.seed(1) train_data <- get_pixels(L5TSR_1986, L5TSR_1986_2001_training, "class_1986", training=.6)

azvoleff/teamlucc documentation built on June 4, 2017, 12:08 a.m.