ordiplot | R Documentation |
This function takes a GLLVM model fit and plots an ordination plot with a random (or specified) selection of draws
ordiplot(
object,
choices = c(1, 2),
type = "species",
summary_stat = "median",
ndraws = 0,
draw_ids = NULL,
size = c(2, 1),
alpha = c(1, 0.5),
shape = c(18, 16),
geom = "point",
errorbar_range = 0.75,
errorbar_linewidth = 1
)
object |
The |
choices |
Which latent variables to plot as dimensions, by default
|
type |
Whether to plot sites or species, default |
summary_stat |
The summary statistic used to plot overall averages of
the posterior sample. By default this is |
ndraws |
How many individual draws to include in plot, by default
|
draw_ids |
Which draws to include in plot (overrides |
size |
The size of the points in the graph, specified as a two-element
vector with the first being used for the summary points and the second the
individual draws, default |
alpha |
The transparency/alpha of the points in the graph, specified as
a two-element vector with the first being used for the summary points and
the second the individual draws, default |
shape |
The shape of the points in the graph, specified as a two-element
vector with the first being used for the summary points and the second the
individual draws, default |
geom |
Which geom from ggplot2 is used for the summary statistic
by default |
errorbar_range |
If specified, the central range of the data that is
covered by the errorbar. Needs to be given as either |
errorbar_linewidth |
The linewidth of the error bar, by default 1. |
A ggplot object that can be customised using the ggplot2 package
## Not run:
# First simulate data and fit the model:
gllvm_data <- jsdm_sim_data(
method = "gllvm", N = 100, S = 6, D = 3,
family = "bernoulli"
)
gllvm_fit <- stan_jsdm(
dat_list = gllvm_data, method = "gllvm",
family = "bernoulli"
)
ordiplot(gllvm_fit)
# now plot the 1st and 3rd latent variables against each other for the sites:
ordiplot(gllvm_fit, choices = c(1, 3), type = "sites")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.