lim: Borders (max and min) of all the values present in its...

View source: R/noNa.r

limR Documentation

Borders (max and min) of all the values present in its arguments.

Description

‘lim’ returns a vector containing the minimum and the maximum values of all the values present in its arguments, omitting NA values. Useful to use automatically determine xlim's and ylim's for plots.

Usage

lim(...)

Arguments

x

A vector containing numeric values

Value

One (or more) vector(s) of numeric values, the minimum and the maximum of the inputs

Examples

x <- c(1,2,3,4,5,NA,7,8,9,NA,11,12)
y <- x^2
z <- x^3
plot(x,y,xlim=lim(x),ylim=lim(y,z))
lines(x,z)


benjaminpeeters/BePe documentation built on July 7, 2022, 5:45 p.m.