Learn R Programming

easynem (version 1.0.3)

calc_lm: Linear regression analysis of easynem-class (single factor)

Description

The calc_lm() function is used for linear regression analysis of easynem-class. Note: Both the horizontal and vertical coordinates of this function must be continuous variables.

Usage

calc_lm(data, group, x, y, ...)

Value

Returns an lme-class object storing the results of a linear regression analysis.

Arguments

data

An easynem-class object.

group

The group variable.

x

X-axis.

y

Y-axis.

...

Other parameters of the lm function.

Details

To facilitate code interpretation, it is recommended to use the pipe symbol |> to connect functions:

nem_lm <- nem |> calc_lm(con_crop, x = SOC, y = pH)

See Also

Other functions in this R package for data calculations: calc_beta2, calc_compare, calc_compare2, calc_beta, calc_alpha, calc_nemindex, calc_funguild, calc_funguild2, calc_mf2, calc_mf, calc_ter2, calc_ef, calc_ef2, calc_lm2

Examples

Run this code
nem <- read_nem2(tab = nemtab, tax = nemtax, meta = nemmeta)
nem_index <- nem |>
             calc_alpha() |>
             calc_nemindex() |>
             calc_lm(group = Treatments,
                     x = Chao1,
                     y = TotalBiomass)
nem_index

Run the code above in your browser using DataLab