uphist {MQMF}R Documentation

uphist a histogram with an upper limit on the x-axis

Description

uphist is merely a wrapper around the base hist function, which adds the ability to limit the upper value on the x-axis. With fisheries data it is surprisingly common to have data that has a very few extreme values that can obscure a standard plot of the data. The data are only truncated within the uphist function so any other analyses will be on all available data. If a maximum value is selected which accidently eliminates all available data the script stops with an appropriate warning. If a value is selected which fails to eliminate any data then all data are used with no warning.

Usage

uphist(x, maxval = NA, newplot = FALSE, ...)

Arguments

x

the vector of values to be plotted as a histogram

maxval

the maximum value to be retained in the plotted data

newplot

is this a new, individual plot (=TRUE) or part of a multiple pane plot (=FALSE, the default), which would negate using the notion of recording the environment's par setting in oldpar, and returning to them on exit

...

any of the other arguments used by the base hist function

Value

nothing, but it does plot a histogram

Examples

  x <- rlnorm(5000, meanlog=2, sdlog=1)
  hist(x,breaks=30,main="",xlab="log-normal values")
  uphist(x,breaks=30,main="",xlab="log-normal values",maxval=100)
  uphist(x,breaks=30,main="",xlab="log-normal values",maxval=1000)

[Package MQMF version 0.1.5 Index]