cover_trans: Convert cover scales to percent cover

cover_transR Documentation

Convert cover scales to percent cover

Description

Convert values of a categorical cover scale to percentage values.

This function requires as input a coverconvert object which contains the conversion tables.

Usage

## S4 method for signature 'character,coverconvert'
cover_trans(x, conversion, from = NULL, rule = "top", zeroto = 0.1, ...)

## S4 method for signature 'factor,coverconvert'
cover_trans(x, conversion, ...)

## S4 method for signature 'numeric,coverconvert'
cover_trans(x, conversion, ...)

## S4 method for signature 'vegtable,missing'
cover_trans(x, to, replace = FALSE, rule = "top", zeroto = 0.1, ...)

Arguments

x

Either a factor or character vector, or a vegtable object.

conversion

An object of class vegtable.

from

Scale name of values in x as character value.

rule

A character value indicating the rule applied for cover transformation. Three rules are implemented for transformation, either top (values transformed to the top of the range), middle (transformation at the midpoint), and bottom (conversion at the lowest value of the range). In the later case, if the bottom is zero cover, a fictive bottom value can be set by 'zeroto'

zeroto

Value set for transformation of classes with bottom at 0% cover.

...

Further arguments passed from or to other methods.

to

Name of the column in slot samples for writing converted values.

replace

Logical value indicating whether existing cover values should be replaced by the new computed values or not.

Value

Either a vector or a vegtable object.

Author(s)

Miguel Alvarez kamapu78@gmail.com

Examples

## Check the available scales
summary(Kenya_veg@coverconvert)

## Conversion by default 'top' rule
Kenya_veg <- cover_trans(Kenya_veg, to = "percent")
summary(as.factor(Kenya_veg@samples$percent))

## Conversion by 'middle' rule
Kenya_veg <- cover_trans(Kenya_veg, to = "percent", rule = "middle", replace = TRUE)
summary(as.factor(Kenya_veg@samples$percent))

## Conversion by 'bottom' rule
Kenya_veg <- cover_trans(Kenya_veg, to = "percent", rule = "bottom", replace = TRUE)
summary(as.factor(Kenya_veg@samples$percent))

vegtable documentation built on March 31, 2023, 10:33 p.m.