User Tools

Site Tools


recol:taman-data-visualisation

Visualisation of Tamanshan census data

taman <- readr::read_delim ('https://gist.githubusercontent.com/zdealveindy/901dc3b30997a2378e5421aa1390c926/raw/50480004df7d774a62e51b2afed0b0104df0988a/tamanshan_tree_census.txt', delim = '\t')
 
png ('taman-3-plots.png', width = 12, height = 4, units = 'in', res = 150)
set.seed (1234)
par (mfrow = c(1,3))
col.spe <- tibble (spe = as.factor (sort (unique (taman$Species_name))), col = as.character (rainbow (36)))
taman.for.plot <- taman %>% group_by (Plot_ID, Species_name, Individual_ID) %>% mutate (x = runif (1), y = runif (1)) %>% left_join (col.spe, by = c('Species_name' = 'spe'))
 
par (mfrow = c(1,3), mar = c(5,5,5,5))
for (i in unique (taman.for.plot$Plot_ID))
  plot (y ~ x, data = taman.for.plot[taman.for.plot$Plot_ID == i,], main = list (i, cex = 2.5), col = as.data.frame (taman.for.plot[taman.for.plot$Plot_ID == i,'col'])[,1], pch = 16, cex = log (as.data.frame (taman.for.plot[taman.for.plot$Plot_ID == i,'DBH'])[,1]), xlab = list ('20 m', cex = 2), ylab = list ('20 m', cex = 2), asp = 1, axes = FALSE, frame.plot = TRUE)
dev.off ()
 

recol/taman-data-visualisation.txt · Last modified: 2017/12/19 19:47 by david