文档详情

Introduction to Ecological Analysis in R-Day外文翻译.pdf

发布:2017-07-06约1.07万字共6页下载文档
文本预览下载声明
Introduction to Ecological Analysis in R (Day 3) Matthew Lau November 14, 2008 1. Community Analysis Continued (a) Multivariate Tests for Dierences in Community Composition i. AnoSim ii. MRPP iii. PerMANOVA (b) Indicator Species Analysis 2. Looping: Getting R to Do Many Individual Tests 1 Community Analysis Continued The data file ”CommData.csv” has both our species abundance data and our grouping data combined in one matrix. First we need to separate the two: com.data - read.csv(CommData.csv) com - com.data[, -1] env - factor(com.data[, 1]) 1.1 Multivariate Tests for Dierences in Community Com- position We now have a vector ”env”, which is formatted as a factor using fac- tor, containing the grouping data and a matrix ”com” composed of our species abundance data. Here are three ways to test for dierences in composition between our two groups using commands available in the vegan package, which we installed last time: library(vegan) 1.1.1 Analysis of Similarity (AnoSim) For this test, we first need to convert our species abundance data into dissimilarities (i.e. distances) using the vegdist function. We then use the anosim function on our distances specifying our groups with our ”env” data vector: 1 - vegdist(com, method = bray) anosim(dis = , grouping = env) Call: anosim(dis = , grouping = env) Dissimilarity: bray ANOSIM statistic R: 1 Significance: 0.001 Based on 1000 permutations 1.1.2 Multiple Response Permutation Procedure (MRPP) Here, we basically do the exact same thing, except that we don’t have to convert our abundance matrix to a distance matrix. The functio
显示全部
相似文档