Skip to contents

Plots predictive interval for a given taxon and trait-pair

Usage

Plot_trait(
  Taxon,
  params = c("K", "M"),
  Database = FishLife::FishBase_and_RAM,
  Cov_gjj = Database$Cov_gvv,
  Mean_gj = Database$beta_gv,
  ParentChild_gz = Database$ParentChild_gz,
  Y_ij = Database$Y_ij,
  g_i = Database$g_i,
  SpeciesMatch = NULL,
  prob = 0.95,
  add = FALSE,
  xlim = log(c(0.01, 2)),
  ylim = xlim,
  partial_match = TRUE,
  main = "",
  xlab = "",
  ylab = "",
  lcol = "black",
  plot_lines = FALSE,
  verbose = FALSE,
  ticks = c(0, 5),
  logticks = c(1, 2, 5),
  obsCov_jj = Database$obsCov_jj,
  include_obscov = FALSE,
  lty = "solid",
  xaxt = "s",
  yaxt = "s",
  ...
)

Arguments

Taxon

A taxon (matching row from ParentChild_gz[,'ChildName'])

params

character vector (length of two) of parameters to plot

Database

Whether to use results for both adult and stock-recruit parameters, Database="FishBase_and_RAM", or just adult parameters, Database="FishBase"

Cov_gjj

Array of estimated covariance for each taxonomic group g and trait j

Mean_gj

Matrix of Empirical Bayes predictions of traits for each taxonomic group

ParentChild_gz

Matrix representing taxonomic tree for analyzed data

Y_ij

a data frame of trait values (perhaps log-scaled) with rows for records, and tagged-columns for traits

g_i

Vector that associates every observation with a level of the taxonomic tree

SpeciesMatch

Species for which to plot data

prob

for defining predictive interval

add

Boolean whether to add ellipse to existing plot

xlim

x-limits if add=FALSE

ylim

y-limits if add=FALSE

partial_match

Should Taxon be an partial match or not (exact match)

main

legend for each panel

xlab

x-axis label

ylab

y-axis label

lcol

line color for ellipse

plot_lines

whether to plot lines representing "major axis" and "OLS" regression parameters

verbose

Boolean whether to print name matches or not

ticks

ticks to use if plotting on a natural-scale

logticks

ticks to use if plotting on a log-scale

...

additional arguments passed to shape::plotellipse