Description Usage Arguments Value See Also Examples
This function takes a fitted boral model and returns a data frame to use
with ggplot for an ordination-style bi-plot of latent variables and
coefficients. It is used by function gg_lvsplot
but you
can also use it directly.
1 | gg_lvsplot_data(model, scaling = 1)
|
model |
A boral model fitted with one or more latent variables. |
scaling |
A numeric value between 0.8 and 1.2 that controls the relative scaling of latent variables (e.g. sites) and latent variable coefficients (e.g. species). |
A data frame with n
column(s) for the values of the n
latent variables; a column var
specifying whether a row is for
latent variable ('lv'
) or coefficient ('lvcoef'
) values;
and a column label
giving object (e.g. site) name for 'lv' rows
and attribute (e.g. species) name for 'lvcoef' rows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
dat.gg <- gg_lvsplot_data(mymodel)
# Draw 'manually' with ggplot as an alternative to using
# the gg_lvsplot function
library(ggplot2)
library(ggrepel)
ggplot(data = dat.gg, aes(x = lv1, y = lv2, colour = var)) +
geom_point() +
geom_text_repel(aes(label = label)) +
theme(legend.position = "none")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.