Learn R Programming

easynem (version 1.0.3)

nem_plot,beta2-method: Visualization of beta diversity results (two-factor)

Description

The nem_plot function is generalized to the beta2-class and is used to visualize the two-factor beta diversity results.

Usage

# S4 method for beta2
nem_plot(object, level = 0.6, type = 1, ...)

Value

An gg or ggplot object.

Arguments

object

A beta2-class object.

level

Used to adjust the size of the confidence ellipse. Default level = 0.6. See stat_ellipse.

type

Method used to adjust the display of scatter area. type = 1, displays as a confidence ellipse; type = 2, displays as a polygon. Default type = 1.

...

Other parameters to be expanded.

Details

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

nem_plot <- nem |> calc_beta2(pca, con_crop, season, method = "bray") |> nem_plot()

See Also

The nem_plot() is used to visualize the calculation results and is a generalized function for multiple classes including beta-class, beta2-class, compare-class, compare2-class, ef-class, ef2-class, funguild-class, funguild2-class, mf-class, mf2-class, ter-class, ter2-class, etc.

Examples

Run this code
nem <- read_nem(tab = easynem_example("nemtab1.csv"),
                tax = easynem_example("nemtax1.csv"),
                meta = easynem_example("nemmeta1.csv"))
nem_plot <- nem |>
            calc_beta2(pcoa, con_crop, season, method = "bray") |>
            nem_plot(level = 0)
nem_plot
nem_plot <- nem |>
            calc_beta2(nmds, con_crop, season, method = "bray") |>
            nem_plot(type = 2)
nem_plot

Run the code above in your browser using DataLab