User Tools

Site Tools


You are not allowed to perform this action
cs:mix:coral_reef_betadiversity:solution
tikus.spe <- read.csv2 ('http://www.davidzeleny.net/anadat-r/data-download/tikus-spe.csv', row.names = 1, dec = '.')
tikus.env <- read.csv2 ('http://www.davidzeleny.net/anadat-r/data-download/tikus-env.csv', dec = '.')
 
# choose years 1981, 1983 and 1985
tikus.spe.sel <- tikus.spe[tikus.env$Year %in% c(1981, 1983, 1985), ]
 
library (vegan)
bray <- vegdist (tikus.spe.sel)
eucl <- dist (log (tikus.spe.sel + 1))
 
nmds.bray <- metaMDS (bray)
plot (nmds.bray, type = 'n')
points (nmds.bray, pch = c (rep (1, 10), rep (2, 10), rep (3, 10)))
legend ('topright', pch = c(1,2,3), legend = c ('1981', '1983', '1985'), bty = 'n')
 
nmds.eucl <- metaMDS (eucl)
plot (nmds.eucl, type = 'n')
points (nmds.eucl, pch = c (rep (1, 10), rep (2, 10), rep (3, 10)))
legend ('topright', pch = c(1,2,3), legend = c ('1981', '1983', '1985'), bty = 'n')

cs/mix/coral_reef_betadiversity/solution.txt · Last modified: 2017/10/11 20:36 (external edit)