File: bit_in.Rd

package info (click to toggle)
r-cran-bit 4.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 996 kB
  • sloc: ansic: 5,083; makefile: 6
file content (34 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bitsort.R
\name{bit_in}
\alias{bit_in}
\title{bit \%in\%}
\usage{
bit_in(x, table, retFUN = as.bit)
}
\arguments{
\item{x}{an integer vector of values to be looked-up}

\item{table}{an integer vector used as lookup-table}

\item{retFUN}{a function that coerces \code{\link{bit}} and \code{\link{logical}} vectors}
}
\value{
a boolean vector coerced to \code{retFUN}
}
\description{
fast \code{\link{\%in\%}} for integers
}
\details{
determines the range of the integers and checks if the density justifies use 
of a bit vector; if yes, maps \code{x} or \code{table} -- whatever is smaller
-- into a bit vector and searches the other of \code{table} or \code{x} in
the it vector; if no, falls back to \code{\link{\%in\%}}
}
\examples{
bit_in(1:2, 2:3)
bit_in(1:2, 2:3, retFUN=as.logical)
}
\seealso{
\code{\link{\%in\%}}
}