1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Do not modify this file since it was automatically generated from:
%
% mapToIntervals.R
%
% by the Rdoc compiler part of the R.oo package.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\name{mapToIntervals.numeric}
\alias{mapToIntervals.numeric}
\title{Maps values to intervals}
\usage{
\method{mapToIntervals}{numeric}(x, intervals, includeLower=TRUE, includeUpper=TRUE, ...)
}
\description{
Maps values to intervals by returning an index \code{\link[base]{vector}} specifying the (first)
interval that each value maps to, if any.
}
\arguments{
\item{x}{A \code{\link[base]{numeric}} \code{\link[base]{vector}} of K values to be matched.}
\item{intervals}{The N intervals to be matched against.
If an Nx2 \code{\link[base]{numeric}} \code{\link[base]{matrix}}, the first column should be the lower
bounds and the second column the upper bounds of each interval.
If a \code{\link[base]{numeric}} \code{\link[base]{vector}} of length 2N, each consecutive pair should
be the lower and upper bounds of an interval.
}
\item{includeLower, includeUpper}{If \code{\link[base:logical]{TRUE}}, the lower (upper) bound
of \emph{each} interval is included in the test, otherwise not.}
\item{...}{Not used.}
}
\value{
Returns an \code{\link[base]{integer}} \code{\link[base]{vector}} of length K.
Values that do not map to any interval have return value \code{\link[base]{NA}}.
}
\author{Henrik Bengtsson}
\seealso{
\code{\link{inAnyInterval}}().
\code{\link[base]{match}}().
\code{\link[base]{findInterval}}().
\code{\link[base]{cut}}().
}
\keyword{methods}
\keyword{utilities}
\keyword{programming}
|