histMulti: Multipanel Histogram of Values

Description Usage Arguments Examples

View source: R/histMulti.R

Description

Multipanel histogram of values, one histogram for each group.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
histMulti(
  x,
  freq = rep(1, length(x)),
  bygroup,
  sug = sort(unique(bygroup)),
  xlab = "Values",
  ylab = "Frequency",
  barw = 5,
  samescale = TRUE,
  fillcol = "gray",
  rangecol = "red",
  mar = c(3, 3, 2, 1),
  oma = c(2, 2, 1, 1)
)

Arguments

x

Numeric vector of values to be plotted.

freq

Numeric vector of frequencies corresponding to x, default a vector of 1s the same length as x.

bygroup

Vector, identifying the group membership of the values to be plotted.

sug

Vector, identifying the unique groups to which locations may belong, default sort(unique(bygroup)).

xlab

Character scalar, label to assign to collection of x-axes.

ylab

Character scalar, label to assign to collection of y-axes.

barw

Numeric scalar, the width of the bars in units of x, default 5.

samescale

Logical scalar, indicating if the same (TRUE, default) or different (FALSE) lon/lat scales should be used for all panels.

fillcol

A scalar, the color used to fill the histograms, default "gray".

rangecol

A scalar, the color used to draw the lines denoting the range of values, default "red".

mar

A numeric vector of length 4, the number of lines of margin c(bottom, left, top, right) around each plotted map plot, default c(3, 3, 2, 1).

oma

A numeric vector of length 4, the number of lines of the outer margin c(bottom, left, top, right) around the entire collection of panels, default c(2, 2, 1, 1).

Examples

1
2
3
4
5
myval <- c(23, 35, 47, 62)
myfreq <- c(5, 2, 3, 4)
mygroup <- c("A", "A", "B", "B")
histMulti(x=myval, freq=myfreq, bygroup=mygroup)
histMulti(x=myval, freq=myfreq, bygroup=mygroup, samescale=FALSE)

JVAdams/EchoNet2Fish documentation built on Feb. 15, 2021, 4:27 a.m.