# Tree community matrix (by stem counts)
comm_stem <- xtabs(~ plot + species, data = novelforest_data$trees)
comm_stem[1:10, 1:4]
# Species occurrence matrix (of all vascular plants)
comm_all <- xtabs(~ plot + species, data = novelforest_data$pres)
comm_all[1:10, 1:4]
# Reproduce (part of) the summary table (Appendix S2) in the supplementary
# material of Neo et al. (2017)
with(novelforest_data,
apply(plots[3:8], 2,
function(x) tapply(x, plots$patch, mean, na.rm = TRUE))
)
Run the code above in your browser using DataLab