Introduction to R for Ecologists
R語言在生態學的應用
EEB5082 (B44U1940)
Author: David Zelený
Permalink: davidzeleny.net/link/recol
Introduction to R for Ecologists
R語言在生態學的應用
EEB5082 (B44U1940)
Author: David Zelený
Permalink: davidzeleny.net/link/recol
Collection of datasets used during the class for exercise
moll <- read.delim ('http://www.davidzeleny.net/wiki/lib/exe/fetch.php/recol:data:molluscs-fens.txt', row.names = 1) env <- read.delim ('http://www.davidzeleny.net/wiki/lib/exe/fetch.php/recol:data:env-fens.txt', row.names = 1)
x <- c('Chamaecyparis formosensis', 'Abies kawakamii', 'Picea morrisonicola')
traits <- readr::read_delim ('https://www.davidzeleny.net/wiki/lib/exe/fetch.php/recol:data:traits_mqu.txt', delim = '\t') localities <- readr::read_delim ('https://www.davidzeleny.net/wiki/lib/exe/fetch.php/recol:data:localities_mqu.txt', delim = '\t')
Dataset: At nine forest localities distributed along elevation in Northern part of Taiwan, we established vegetation plots (20×20 m) and in each plot we selected several dominant tree species. For each individual of selected species, we collected three leaves, and measured several leaf functional traits (SLA, LA, LDMC and thickness). The average of each trait for given tree individual (mean of three measured leaves) is in the table 'traits'. Note that at each locality, there are several species, and some of the species are represented by more than one individual (some have only one individual).
Data downloaded from www.scopus.com and stored in Gist of Github.com.
jvs <- readr::read_delim ('https://gist.githubusercontent.com/zdealveindy/570edaff4e8e776e02d4277980bad842/raw/182132abfbb1042ae4d515dae5d762b00510c59d/scopus-jvs-1990-2016.txt', delim = '\t')
Data sampled by Vegetation Ecology lab. Three plots 20×20 m sampled in elevation around 1850 m in Tamanshan. In each plot, we measured DBH (diameter in breast height) of each tree individual with DBH > 1 cm, and determine it's species. Some individuals have more than one stem - in that case we measured each stem separately and in the record the same individual number occurs on multiple rows, each with different DBH measure. Plot codes are L2R
, L2L
and L2W
. The figure below illustrates the situation (each box = one plot 20×20 m, each point = one tree individual, size of the symbol = proportional to individual's DBH, different color = different species; spatial distribution does not reflect the reality. The script creating figure is here).
tamanshan <- readr::read_delim ('https://gist.githubusercontent.com/zdealveindy/901dc3b30997a2378e5421aa1390c926/raw/50480004df7d774a62e51b2afed0b0104df0988a/tamanshan_tree_census.txt', delim = '\t')
From Manipulating big data in R for vegetation scientists (Viktoria Wagner) Chapter 7.2
plot.vec <- c("P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10", "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10", "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10", "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10") lat.vec <-c(-25.628, 22.504, -3.515, 1.400, -11.661, 16.936, -2.787, -11.767, 10.209, -5.747, -25.628, 22.504, -3.515, 1.400, -11.661, 16.936, -2.787, 2-11.767, 10.209, -5.747, -25.628, 22.504, -3.515, 1.400, -11.661, 16.936, -2.787, -11.767, 10.209, -5.747, -25.628, 22.504, -3.515, 1.400, -11.661, 16.936, -2.787, -11.767, 10.209, -5.747) long.vec <- c(27.501, -21.998, -48.671, 17.081, 7.165, -0.839, -6.539, -0.644, 17.802, NA, -27.501, -21.998, -48.671, 17.081, 7.165, -0.839, -6.539, -0.644, 17.802, NA, -27.501, -21.998, -48.671, 17.081, 7.165, -0.839, -6.539, -0.644, 17.802, NA, -27.501, -21.998, -48.671, 17.081, 7.165, -0.839, -6.539, -0.644, 17.802, NA) spec.vec <- c("spec1", "spec1", "spec1", "spec1", "spec1", "spec1", "spec1", "spec1", "spec1", "spec1", "spec2", "spec2", "spec2", "spec2", "spec2", "spec2", "spec2", "spec2", "spec2", "spec2", "spec3", "spec3", "spec3", "spec3", "spec3", "spec3", "spec3", "spec3", "spec3", "spec3", "spec4", "spec4", "spec4", "spec4", "spec4", "spec4", "spec4", "spec4", "spec4", "spec4") abund.vec <-c(20, 5, 20, 1, 0, 0, 0, 20, 5, 10, 0, 0, 40, 1, 0, 0, 0, 5, 0, 5, 10, 50, 0, 5, 10, 0, 1, 0, 5, 10, 5, 0, 10, 10, 30, 5, 0, 0, 50, 30) long.data <- data.frame(plot = plot.vec, lat = lat.vec, long = long.vec, spec = spec.vec, abund = abund.vec)
From Manipulating big data in R for vegetation scientists (Viktoria Wagner) Chapter 7.1
lat.vec.w <- c(-25.628, 22.504, -3.515, 1.400, -11.661, 16.936, -2.787, -11.767, 10.209, -5.747) long.vec.w <- c(-27.501, -21.998, -48.671, 17.081, 7.165, -0.839, -6.539, -0.644, 17.802, NA) wide.data <- data.frame(plot = c(paste("P", 1:10, sep="")), spec1 = c(20,5,20,1,0,0,0,20,5,10), spec2 = c(0,0,40,1,0,0,0,5,0,5), spec3 = c(10,50,0,5,10,0,1,0,5,10), spec4 = c(5,0,10,10,30,5,0,0,50,30), lat = lat.vec.w, long = long.vec.w)