harmoniseLevels | R Documentation |
Given several factors (or factor-valued pixel images) convert them so that they all use the same set of levels.
harmoniseLevels(...)
... |
Factors, or factor-valued pixel images. |
All of the arguments ...
must be factors, or factor-valued
pixel images (objects of class "im"
).
The levels
of each factor will be extracted, and
combined by taking the union of all the levels. Then each factor will
be converted to a new factor so that all of the new factors have
exactly the same set of levels.
A list, containing the same number of arguments as the input, consisting of factors or factor-valued pixel images.
.
levels
, levels.im
,
mergeLevels
.
(a <- factor(sample(letters[1:3], 10, replace=TRUE)))
(b <- factor(sample(LETTERS[1:4], 7, replace=TRUE)))
harmoniseLevels(a,b)
(A <- gorillas.extra$vegetation)
(B <- gorillas.extra$slopetype)
harmoniseLevels(A,B)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.