Using EwEvis

Marc Taylor

2019-11-28

Note: The following graphical examples can be rotated by clicking with the left mouse button and moving, and zooming via the center wheel.

library(EwEvis)
library(rgl)
## Warning: package 'rgl' was built under R version 3.6.1
## Warning: package 'knitr' was built under R version 3.6.1

Required data

# Northern Humboldt Current Ecosystem (La Niña, Tam et al. 2008)
TEgm <- 0.1014 # mean transfer efficiency (trophic levels 2-4)
Ts <- c(27165, 22349, 1658, 266.3, 17.45, 0.607, 0.00515, 6e-06) # Throughout
Bs <- c(62.84, 147.1, 70.05, 20.61, 1.658, 0.084, 0.000657, 1e-06, 0) # Biomass

3d trophic boxes (Vbox3d)

Comparison plot (biomass example)

open3d()
## wgl 
##   1
# color palatte
pal <- colorRampPalette(c("green", "yellow", "red"), bias=3)
# Biomass
tmp1 <- Vbox3d(V=Bs[1:5], TL.len = 10, col=pal(5), add.scale = FALSE)
# Throughput
tmp2 <- Vbox3d(V=Ts[1:5], TL.len = 10, col=pal(5), add.scale = TRUE,  shift=c(dist(tmp1[[1]]$vb[1,1:2])*20,0,0), scale.len = 1000^(1/3)
)

You must enable Javascript to view this page properly.

3d trophic pyramid (Vpyramid3d)

Effect of TEgm on top angle (throughput example)

open3d()
## wgl 
##   2
tmp <- Vpyramid3d(V=Ts[2:8], TEgm = 0.07, col=2:7, 
    add.scale = FALSE
)
tmp2 <- Vpyramid3d(V=Ts[2:8], TEgm = 0.1, col=2:7,
   shift=c(dist(tmp[[1]]$vb[1,1:2])*1.1,0,0),
   add.scale = FALSE
)
tmp3 <- Vpyramid3d(V=Ts[2:8], TEgm = 0.15, col=2:7,
  shift=c(dist(tmp[[1]]$vb[1,1:2])*1.1*2,0,0),
  add.scale = TRUE, scale.len = 1000^(1/3)
)

# add labels
pos <- data.frame(rbind(
  rowMeans(tmp[[7]]$vb),
  rowMeans(tmp2[[7]]$vb),
  rowMeans(tmp3[[7]]$vb)
))
names(pos) <- c("x", "y", "z", "w")

text3d(pos$x, y=pos$y, z = pos$z+3,
          text=paste("TE =", c("7%", "10%", "15%")),
       color="black", font=2
) 

You must enable Javascript to view this page properly.

References

Tam, J., Taylor, M.H., Blaskovic, V., Espinoza, P., Michael Ballón, R., Díaz, E., Wosnitza-Mendo, C., Argüelles, J., Purca, S., Ayón, P., Quipuzcoa, L., Gutiérrez, D., Goya, E., Ochoa, N., Wolff, M., 2008. Trophic modeling of the Northern Humboldt Current Ecosystem, Part I: Comparing trophic linkages under La Niña and El Niño conditions. Progress in Oceanography 79, 352–365. doi:10.1016/j.pocean.2008.10.007