Questions tagged [vegan]

vegan is a package for use with R for the analysis of ecological communities, especially vegetation communities. It has tools for analyzing ecological diversity and for the multivariate analysis of communities (NMDS, pCCA, pRDA, etc.)

Vegan is an package that provides ordination methods, diversity analysis and other functions for community and vegetation ecologists.

Vegan contains many popular tools used in community ecology:

  • Diversity analysis: Shannon, Simpson, Fisher indices, Rényi diversities and Hill numbers.
  • Species abundance models: Fisher and Preston models, species abundance distributions.
  • Analysis of species richness: species accumulation curves, extrapolated richness.
  • Ordination: support and meta functions for NMDS, redundancy analysis, constrained correspondence analysis, constrained analysis of proximities (all three with partial analysis),
  • Support functions for ordination: dissimilarity indices, extended dissimilarities, Procrustes analysis, ordination diagnostics, permutation tests.
  • Ordination and environment: vector fitting, centroid fitting and smooth surface fitting, adding species scores as weighted averages, adding convex hull, SD ellipses, arrows etc. to ordination.
  • Dissimilarity analyses: ANOVA using dissimilarities, ANOSIM, MRPP, BIOENV, Mantel and partial Mantel tests.
  • Data standardization: Hellinger, Wisconsin, Chi-square, Beals smoothing.

Repositories

Vignettes

Other resources

Related tags

585 questions
0
votes
3 answers

Calculating diversity indices across sites in R

I have a dataframe(df)as follows: Year PlotNo HabitatType Sp1 Sp2 Sp3 Sp4 2000 1 GH 0 1 2 3 1988 3 KL 2 3 4 5 where, Sp stands for Species and its columns represent abundance value. I'm trying to find the…
biogeek
  • 197
  • 3
  • 8
0
votes
1 answer

R: Summing frequency in a list

Edit: Packages used are: plyr and vegan. R is most up to date version. My base data is this: X1 = c('Archea01', 'Bacteria01', 'Bacteria02') Sample1 = c(0.2,NA,NA) Sample2 = c(0, 0.001, NA) Sample3 = c(0.04, NA, NA) df =…
E.O.
  • 351
  • 2
  • 14
0
votes
1 answer

How do you determine how many variables is too many for a CCA?

I am running a CCA of some ecological data with ~50 sites and several hundred species. I know that you have to be careful when your number of explanatory variables approaches your number of samples. I have 23 explanatory variables, so this isn't a…
setbackademic
  • 143
  • 3
  • 11
0
votes
1 answer

R vegan CCA, determine which constraints were aliased?

I've performed a CCA using vegan and plotted with biplot arrows. the "ca" output tells me I have "Some constraints were aliased because they were collinear (redundant)". I understand that that means the constraints were dropped because they were…
shu251
  • 241
  • 1
  • 4
  • 14
0
votes
1 answer

change significant figures in adonis in R?

The adonis function in R apparently defaults to 3 sig-figs in the output p-values. Can this be altered such that higher sig-figs are output?
0
votes
1 answer

Empty data frame when computing ellipse data with vegan's ordiellipse for ggplot

I am trying to group data points of an NMDS in ggplot by adding ellipses using the ordiellipse function following the helpful advice from this post. However, although I don't get any error messages or warnings, calculating the ellipse data produces…
jonfen
  • 3
  • 3
0
votes
2 answers

Legend appears, but it does not show color

I am using R for plotting. When my graph plots the legend appears where I want it to be but the colors are missing. mtcars 2 is a modified version of mtcars (one of the pre-loaded data sets) that adds a model and country of origin to the data set.…
Hecker G
  • 1
  • 1
  • 2
0
votes
1 answer

change y axis in species accumulation curves in vegan into percentages

I would like to create a species accumulation curve in R (I tried using the vegan package), but instead of showing the number of species on the y axis, I would like to indicate the % of total number of species on the y axis. This would allow me to…
user15930
  • 3
  • 2
0
votes
2 answers

how do i add vectors to a (Vegan package) ordihull plot?

how do i add vectors (illustrating annual change) to a ordihull plot? I have created a ordihull plot illustrating the years 2011, 2013 and 2015 each with it's own colour. now i would like to see if all locations change in the same direction or if…
A_DK
  • 33
  • 1
  • 3
0
votes
1 answer

Vegan package point colour

I am using the following code for MDS plotting and I have trouble with changing the point symbol and colour using pch and col options. Here it is my code: library(vegan) library(RColorBrewer) xc <- cor(my.data, use = "pairwise.complete.obs",…
VasoGene
  • 141
  • 3
  • 12
0
votes
1 answer

How to compute Ochiai distance matrix with pairwise deletion in R

I have a presence/absence dataset and need to calculate an Ochiai distance matrix with pairwise deletion of missing values. What is the simplest way to do this? I can use designdist from the vegan package to generate a matrix, but not sure what it…
0
votes
0 answers

Why am I missing 2 Environmental Variable vectors from CCA plot in R (vegan package)?

My input file is organized with sample ID as the row name, and each column representing a certain Operational Taxonomic Unit, with the data being a number for Absolute Abundance of that OTU. I set up the csv file with binary dummy variables to…
RDC
  • 1
0
votes
1 answer

Error when using R betadisper function

The 'betadisper' funtion in vegan [R] calculates the multivariate dispersion of a group of sites based on their distances I have a distance matrix with multiple groups of sites: dis <- vegdist(correct_tree_data) I created my 'groups' using the…
0
votes
1 answer

How to select a genetic distance range to plot a mst using vengan library

I've tried to perform a genetic distance analysis using ape and vegan. First of all I calculated genetic distances using ape: data<-read.dna(file = "proof.txt", format = 'fasta') D <- dist.dna(data, model ='TN93', as.matrix ='TRUE') this code gives…
Mia Lua
  • 157
  • 1
  • 11
0
votes
1 answer

degrees of freedom in vector fitting using envfit (vegan)

I used the envfit() in the vegan package to determine the environmental gradients controlling the 2 NMDS axes. I had 2 categorical environmental (factors) and 4 continuous variables (vectors). My question is does vector fitting give degrees of…
tg110
  • 401
  • 1
  • 3
  • 15