getmaxy: getmaxy generates the upper bound for a plot

View source: R/datalow_utils.r

getmaxyR Documentation

getmaxy generates the upper bound for a plot

Description

getmaxy generates an upper bound for a plot where it is unknown whether the maximum is greater than zero of not. If > 0 then multiplying by the default mult of 1.05 works well but if the outcome if < 0 then the multiplier needs to be adjusted appropriately so the maximum is slightly higher than the maximum of the data

Usage

getmaxy(x, mult = 1.05)

Arguments

x

the vector of data to be tested for its maximum

mult

the multiplier for both ends, defaults to 1.05 (=0.95 if < 0)

Value

a suitable upper bound for a plot if required

Examples

## Not run: 
vect <- rnorm(10,mean=0,sd=2)
sort(vect,decreasing=TRUE)
getmaxy(vect,mult=1.0)
vect <- rnorm(10,mean = -5,sd = 1.5)
sort(vect,decreasing=TRUE)
getmaxy(vect,mult=1.0)

## End(Not run)

haddonm/datalowSA documentation built on Nov. 5, 2023, 6:40 p.m.