plot.ae: Plot an ae object

View source: R/plot_ae.R

plot.aeR Documentation

Plot an ae object

Description

Plots age estimates of samples with bootstrap confidence intervals.

Usage

## S3 method for class 'ae'
plot(
  x,
  groups = NULL,
  subset = NULL,
  show.boot_estimates = T,
  show.prior = F,
  col = par("fg"),
  color = col,
  col.b = 2,
  col.p = 1,
  col.l = "gray",
  pch = 16,
  cex = 1,
  truncate_name = c("none", "end", "start"),
  sn_len = 10,
  lmar = 10,
  g.line = lmar * 0.75,
  xlim = NULL,
  xlab = NULL,
  main = NULL,
  CIbar.width = 0.1,
  glob.above = F,
  l.pos = "bottomright",
  ...
)

Arguments

x

an ae object, as returned by ae.

groups

a factor with sample categories (e.g. treatment groups).

subset

an index vector of the samples to plot (defaults to all).

show.boot_estimates

logical ; if TRUE (default), shows individual bootstrap estimates as swarms.

show.prior

logical ; if TRUE, shows input prior(s) on the plot.

col, color

the estimate, confidence interval, and label color.

col.b, col.p, col.l

color of bootstrap estimates, priors, and background lines respectively.

pch, cex, xlim

graphical parameters.

truncate_name

whether to truncate displayed sample names from start, end, or not (default).

sn_len

number of characters to keep when truncating sample names.

lmar

left margin value, increase to fit sample names.

g.line

position of the group names (margin line).

xlab

x axis label.

main

plot title.

CIbar.width

the width of the confidence interval bars.

glob.above

logical ; if TRUE, the global estimate is overlayed above all else.

l.pos

position of the legend when show.prior is TRUE, passed on to legend

...

additional arguments passed on to points.

Examples


requireNamespace('wormRef', quietly = TRUE)

# get some samples to stage
samp <- wormRef::Cel_larval$g[,13:15]

# load interpolated reference
r_larv <- prepare_refdata(ref = 'Cel_larval', datapkg = 'wormRef' , n.inter = 200)

# perform age estimate
ae_test <- ae(samp, r_larv)

# check output
summary(ae_test)
plot(ae_test) # plot all sample estimates
plot_cor(ae_test) # plot individual correlation profiles of samples

# get results
ae_test$age.estimates


LBMC/RAPToR documentation built on April 6, 2023, 12:26 p.m.