mvabund – new R pkg for multivariate abundance data
[This article was first published on Recology - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
There is a new R package in town, mvabund, which does, as they say “statistical methods for analysing multivariate abundance data”. The authors introduced the paper in an online early paper in Methods in Ecology and Evolution here, R package here.
The package is meant to visualize data, fit predictive models, check model assumptions, and test hypotheses about community-environment associations.
Here is a quick example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### mvabund play | |
# install mvabund from CRAN pkg repository | |
install.packages("mvabund") | |
require(mvabund) | |
# plot abundance by copepod species | |
data(Tasmania) | |
attach(Tasmania) | |
tasmvabund <- mvabund(Tasmania$copepods) | |
plot(tasmvabund ~ treatment, col = as.numeric(block)) | |
# fit negative binomial model for each species and plot residuals vs. fitted | |
tas.nb <- manyglm(copepods ~ block*treatment, family="negative.binomial") | |
plot(tas.nb) |
To leave a comment for the author, please follow the link and comment on their blog: Recology - R.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.