plot_zband: Utility functions for adding growth standard bands to...

panel.zbandR Documentation

Utility functions for adding growth standard bands to ggplot2/lattice plots

Description

Utility functions for adding growth standard bands to ggplot2/lattice plots

Usage

panel.zband(x, z = -3:0, color = "green", alpha = 0.25)

geom_zband(obj, x, z = -3:0, color = "green", alpha = 0.25)

Arguments

x

range on x axis that should be covered by bands

z

z-scores at which to draw bands (only need to specify on one side of zero)

color

color to use for bands

alpha

transparency of the bands

obj

ggplot2 object to add z bands to

Examples


## Not run: 
library(ggplot2)
p <- ggplot(data = cpp, aes(x = jitter(agedays), y = haz))
geom_zband(p, x = seq(0, 2600, by = 10)) +
  geom_point()

library(lattice)
xyplot(haz ~ jitter(agedays), data = cpp,
  panel = function(x, y, ...) {
    panel.zband(x)
    panel.xyplot(x, y, ...)
  },
  col = "black", alpha = 0.5
)

## End(Not run)

ki-tools/growthstandards documentation built on Jan. 4, 2024, 2:04 a.m.