Learn R Programming

easynem (version 1.0.3)

calc_lm2: Linear regression analysis of easynem-class (two-factor)

Description

The calc_lm2() 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_lm2(data, group1, group2, x, y, ...)

Value

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

Arguments

data

An easynem-class object.

group1

The group variable factor 1.

group2

The group variable factor 2.

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_lm2(con_crop, season, 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_lm.

Examples

Run this code
nem <- read_nem(tab = easynem_example("nemtab1.csv"),
                tax = easynem_example("nemtax1.csv"),
                meta = easynem_example("nemmeta1.csv"))
nem_lm <- nem |> calc_lm2(con_crop, season, x = pH, y = Fe)

Run the code above in your browser using DataLab