powered by
Fits a surface (contour) plot of an environmental variable to an ordination plot.
gg_ordisurf( ord, env.var, groups = NA, choices = c(1, 2), var.label = "Level", binwidth, pt.size = 3, family = "gaussian", plot = TRUE )
Silently returns the plot and data frames used for the plotting.
An ordination object.
Environmental variable to fit to plot.
A vector of groups (optional).
Axes to plot.
Label for the contour legend; default is "Level."
Controls the number of contours in the plot.
Symbol size.
Error distribution and link function used by the gam function to fit the contours.
A logical for plotting; defaults to TRUE.
Olivia Rata Burge, John Quensen
By default, `binwidth` is calculated as the difference between minimum and maximum values of the variable divided by 15.
The colors for the points are mapped to fill; if you want to rename the legend for the groups (points), use labs(fill="New name").
See the help for stats::family for possible values for family.
https://oliviarata.wordpress.com/2014/07/17/ordinations-in-ggplot2-v2-ordisurf/'
data(varespec) data(varechem) vare.dist <- vegdist(varespec) vare.mds <- monoMDS(vare.dist) gg_ordisurf(vare.mds, env.var = varechem$Baresoil, var.label="Bare Soil")
Run the code above in your browser using DataLab