Vbox3d: 3d trophic level volume boxes

Description Usage Arguments Value Examples

View source: R/Vbox3d.R

Description

3d trophic level volume boxes

Usage

1
2
3
Vbox3d(V, TL.len = 10, col = seq(V), col.bases.only = FALSE,
  alpha = 0.2, add.scale = TRUE, scale.len = 1, shift = c(0, 0, 0),
  draw = TRUE)

Arguments

V

vector of volumes (i.e. biomass, throughput) from lowest to highest trophic level

TL.len

height of trophic level

col

colors of V (vector)

col.bases.only

Logical. Color bases of trophic levels only?

alpha

alpha of V (single value (0-1))

add.scale

logical (TRUE / FALSE) adds scale (cube) to right of box plot

scale.len

length of side of scale cube (units of V)

shift

shift location of plot (x,y,z). Useful in comparitive plots.

draw

Logical. Produce plot (Default: draw = TRUE)

Value

rgl output

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
### data from Tam et al (2008) - Northern Humboldt Current Ecosystem (1995-1996)

# data
TEgm <- 0.1014
Ts <- c(27165, 22349, 1658, 266.3, 17.45, 0.607, 0.00515, 6e-06)
Bs <- c(62.84, 147.1, 70.05, 20.61, 1.658, 0.084, 0.000657, 1e-06, 0)
res <- V2Pdim(V = Ts, TEgm=TEgm)
pal <- colorRampPalette(c("green", "yellow", "red"), bias=3)


# single plot of biomasses by TL
rgl::open3d()
res <- Vbox3d(V=Bs[1:5], TL.len = 2, col=pal(5), scale.len = 1)

# single plot of throughput by TL
rgl::open3d()
res <- Vbox3d(V=Ts[2:5], TL.len = 10, col=pal(4), alpha=0.2, 
 scale.len = 10)

# color bases only
rgl::open3d()
res <- Vbox3d(V=Ts[2:5], TL.len = 10, col=8, col.bases.only = TRUE,
   alpha=0.5, scale.len = 10)

# how to set-up a comparison plot (biomass example)
rgl::open3d()
tmp <- Vbox3d(V=Bs[1:5], TL.len = 2, alpha=0, add.scale = FALSE)
Vbox3d(V=Bs[1:5], TL.len = 2, col=pal(5), 
 shift=c(dist(tmp[[1]]$vb[1,1:2])+5,0,0), scale.len = 1)

marchtaylor/EwEvis documentation built on Dec. 2, 2019, 4:44 p.m.