new_layer: Insert new classification of vegetation layers

new_layerR Documentation

Insert new classification of vegetation layers

Description

A new information table for vegetation layers.

Usage

new_layer(object, layer, ...)

## S4 method for signature 'vegtable,data.frame'
new_layer(object, layer, ...)

new_layer(object, ...) <- value

## S4 replacement method for signature 'vegtable,data.frame'
new_layer(object, ...) <- value

## S4 replacement method for signature 'vegtable,character'
new_layer(object, levels, ...) <- value

Arguments

object

A vegtable object.

layer

A data frame including information on vegetation layers.

...

Further arguments passed among methods.

value

Either a data frame or a character value. In the second case, this value indicates the name of the variable at slot samples that will be set as layer information.

levels

A character vector used to set the levels of the new layer. This is only used in the replacement method using a character value. This input is mandatory when the new layer does not exist in slot samples, otherwise an error message will be retrieved.

Value

A vegtable object with the inserted new relation.

See Also

layers2samples()

Examples

## Modify name in samples
names(Kenya_veg@samples) <- replace_x(names(Kenya_veg@samples),
    old = "LAYER", new = "layer")

## Add installed data frame to layers
new_layer(Kenya_veg) <- veg_layers

## Take a look in the result
summary(Kenya_veg@samples$layer)

## Do it with existing values
data(Kenya_veg)
new_layer(Kenya_veg) <- "LAYER"
summary(Kenya_veg@samples$LAYER)

kamapu/vegtables documentation built on Feb. 17, 2024, 8:29 a.m.