rasclass-class
object.
readRasterFolder(path, samplename = "sample", filenames = NULL,
object = new("rasclass"), asInteger = FALSE)
character
string containing the name of the sample file, the default name is "sample" or equivalently "sample.asc".
character
vector containing the names of the files used as explanatory (dependent) variables in the classifictaion.
rasclass-class
object to store the data in.
rasclass-class
object containing the loaded data as a dataframe in the data
slot.
readRasterFolder
function only keeps track of data raster cells that have an observed value in every input layer provided, except for the sample layer. Therefore if any of the layers representing the independent variables in the classification has a NA value in a cell, none of the cell values will be stored. The resulting grid structure of the minimum area with complete inforamtion of each cell is stored as a dummy variable vector in the gridSkeleton slot. If there are memory constraints when loading large raster files, the order of reading the input raster files can be specified using the filenames option to optimize memory usage. In that way, by specifying the input raster with the most NA
values as first file to read, the number of cells kept from all the other raster files read subsequently is reduced.data
slot of a rasclass-class
object, wich can be used for classification using one of the rasclass algorithms. The names of the files provided are stored in the column names of the stored dataframe.It is required that all the input raster files in the specified folder have the same extent and gridsize (i.e. have the same header) and are in the same projection. The rasclass classifier methods assume that all rasters are aligned and have he same grid size. An identical header and projection system of all the files assures this comparability of all input layers in the subsequent classification.
The rasclass classifiers are supervised classification algorithms and therefore a sample file has to be provided. The sample file contains the training cells for the models. The default sample file name is "sample", if the sample file has another name it can be specified using the optional argument samplename. The ".asc" extension is not required in the filenames, they are added and stripped off, depending on the use of the names.
rasclass-package
,
rasclass-class
,
rasclassRaster-class
,## Not run:
# object <- readRasterFolder(path = "mypath", samplename = "mysample",
# filenames = c('myvar1.asc', 'myvar2.asc'))
# object <- classifyRasclass(object)## End(Not run)
Run the code above in your browser using DataLab