Learn R Programming

sjSDM (version 1.0.6)

plotsjSDMcoef: Internal coefficients plot

Description

Plotting coefficients returned by sjSDM model. This function only for model fitted by linear, fitted by DNN is not yet supported.

Usage

plotsjSDMcoef(object, wrap_col = NULL, group = NULL, col = NULL, slist = NULL)

Value

ggplot2 object

Arguments

object

a model fitted by sjSDM

wrap_col

Scales argument passed to wrap_col

group

Define the taxonomic characteristics of a species, you need to provide a dataframe with column1 named “species” and column2 named “group”, default is NULL. For example, group[1,1]== "sp1", group[1,2]== "Mammal".

col

Define colors for groups, default is NULL.

slist

Select the species you want to plot, default is all, parameter is not supported yet.

Author

CAI Wang

Examples

Run this code
if (FALSE) {
library(sjSDM)
# simulate community:
com = simulate_SDM(env = 6L, species = 7L, sites = 100L)

# fit model:
model = sjSDM(Y = com$response,env = com$env_weights, iter = 2L, se = TRUE,
              verbose = FALSE) 

# normal plot
plot(model)

# colored by groups
species=c("sp1","sp2","sp3","sp4","sp5","sp6","sp7")
group=c("mammal","bird","fish","fish","mammal","amphibian","amphibian")
group = data.frame(species=species,group=group)

plot(model,group=group)
}

Run the code above in your browser using DataLab