Description Usage Arguments Value Source References See Also Examples
View source: R/gettestandtrainingsampledf.R
gettestandtrainingsampledf
creates one data.frame
object for
a set of test and training samples that can be used in combination with
tunedagsvm
in order to tune a support vector machine (SVM)
in order to classify values into classes. For each class, there must
exist a an individual image file in a separate directory without any other
files. NULL values must have the rgb values c(255,255,255)
, i.e.
filled with white color. It is possible to subsample the provided samples
and to merge classes.
1 2 | gettestandtrainingsampledf(directorydata, classes, subsamplesize = NULL,
classestomerge = NULL)
|
directorydata |
A character string representing the directory where the image files of the test and training samples are stored. No other files must be in this directory. |
classes |
A character vector with the class labels to use for each class.
The order has to match the order of the files when assessed via
|
subsamplesize |
A numeric vector with the sizes of the subsamples to collect
for each class. The order has to match the order in |
classestomerge |
A list with a vector for each merge of two classes.
Each vector must be a character vector with two elements correspnding to two
elements of |
The function returns a data.frame
object with four columns:
r
The values of the red band of the test and training samples.
g
The values of the greeb band of the test and training samples.
b
The values of the blue band of the test and training samples.
b
The corresponding class labels as factor.
The function relies on the R packages raster
(\insertCiteHijmans.2017TraceIdentification).
1 | #
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.