percdata_lim: Percentage Data Limits

Description Usage Arguments Value Examples

View source: R/percdata_lim.R

Description

Function to calculate axis limits for plots displaying large amounts of data with large spread. This function optimises the xlim and ylim parameters of the final plot in order to include at least a certain percentage of the data points, while minimising the extent of the x and y axes.

Usage

1
2
3
4
5
6
7
8
9
percdata_lim(
  x,
  y,
  perc,
  xlo.start = NULL,
  xhi.start = NULL,
  ylo.start = NULL,
  yhi.start = NULL
)

Arguments

x

X values

y

Y values

perc

The percentage of points which should be included in the final figure

xlo.start

Specify the starting parameter for xlo

xhi.start

Specify the starting parameter for xhi

ylo.start

Specify the starting parameter for ylo

yhi.start

Specify the starting parameter for yhi

Value

Returns the x limits and the y limits for the new plot

Examples

1
2
3
4
x <- rnorm(1000)
y <- rnorm(1000)

percdata_lim(x,y,90)

mathesong/granviller documentation built on April 20, 2020, 7:28 p.m.