Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and ESCI 433/533 tree succession example 1/18/2017 > mat.tree <- matrix(c(0.05, 0.20, 0.25, 0.50, + 0.05, 0.3, 0.50, 0.15, + 0.10, 0.1, 0.45, 0.35, + 0.0, 0.18, 0.22, 0.6), + byrow=T, nrow=4, ncol=4) > mat.tree [,1] [,2] [,3] [,4] [1,] 0.05 0.20 0.25 0.50 [2,] 0.05 0.30 0.50 0.15 [3,] 0.10 0.10 0.45 0.35 [4,] 0.00 0.18 0.22 0.60 > # Enter current numbers of canopy trees > gen1 <- c(100, 20, 60, 24) > # Calculate abundances in next generation as Matrix * Vector(current abundances) > gen2 <- mat.tree %*% gen1 > gen2 [,1] [1,] 36.0 [2,] 44.6 [3,] 47.4 [4,] 31.2 > # Third generation abundances = Matrix * 2nd generation abundances > gen3 <- mat.tree %*% gen2 > gen3 [,1] [1,] 38.170 [2,] 43.560 [3,] 40.310 [4,] 37.176 > # Repeat until proportions do not change > # Alternatively, calculate steady state proportions directly: > climax <- eigen(mat.tree) > climax$vectors [,1] [,2] [,3] [,4] [1,] 0.5+0i -0.0459667-0.2354884i -0.0459667+0.2354884i -0.84023777+0i [2,] 0.5+0i 0.8561036+0.0000000i 0.8561036+0.0000000i -0.45100051+0i [3,] 0.5+0i -0.1436178+0.3004680i -0.1436178-0.3004680i 0.29971029+0i [4,] 0.5+0i -0.2240353-0.2200454i -0.2240353+0.2200454i 0.02779865+0i > # Only first column is ecologically relevant (no imaginary trees) > climax$vectors[,1] [1] 0.5+0i 0.5+0i 0.5+0i 0.5+0i > # Steady state fractions = squared eigenvector components > (climax$vectors[,1])^2 [1] 0.25+0i 0.25+0i 0.25+0i 0.25+0i > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Commands without R prompts and results: mat.tree <- matrix(c(0.05, 0.20, 0.25, 0.50, 0.05, 0.3, 0.50, 0.15, 0.10, 0.1, 0.45, 0.35, 0.0, 0.18, 0.22, 0.6), byrow=T, nrow=4, ncol=4) mat.tree # Enter current numbers of canopy trees gen1 <- c(100, 20, 60, 24) # Calculate abundances in next generation as Matrix * Vector(current abundances) gen2 <- mat.tree %*% gen1 # Third generation abundances = Matrix * 2nd generation abundances gen3 <- mat.tree %*% gen2 # Repeat until proportions do not change # Alternatively, calculate steady state proportions directly: climax <- eigen(mat.tree) # Only first column is ecologically relevant (no imaginary trees) climax$vectors[,1] # Steady state fractions = squared eigenvector components (climax$vectors[,1])^2