1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/bit.R
3\name{booltype}
4\alias{booltype}
5\title{Diagnosing boolean types}
6\usage{
7booltype(x)
8}
9\arguments{
10\item{x}{an R object}
11}
12\value{
13one scalar element of \code{\link{booltypes}} in case of 'nobool' it carries a name attribute with the data type.
14}
15\description{
16Specific methods for \code{booltype} are required, where non-unary methods can combine multiple bollean types, particularly boolean binary operators.
17}
18\details{
19Function \code{booltype} returns the boolean type of its argument.
20There are currently six boolean types, \code{booltypes} is an \code{\link{ordered}} vector with the following ordinal \code{\link{levels}} \describe{
21\item{nobool}{non-boolean types}
22\item{\code{\link{logical}}}{for representing any boolean data including \code{NA} }
23\item{\code{\link{bit}}}{for representing dense boolean data }
24\item{\code{\link{bitwhich}}}{for representing sparse (skewed) boolean data  }
25\item{\code{\link{which}}}{for representing sparse boolean data with few \code{TRUE}}
26\item{\code{\link{ri}}}{range-indexing, for representing sparse boolean data with a single range of \code{TRUE} }
27}
28}
29\note{
30do not rely on the internal integer codes of these levels, we might add-in \code{\link[ff]{hi}} later
31}
32\examples{
33unname(booltypes)
34str(booltypes)
35sapply(list(double(),integer(),logical(),bit(),bitwhich(),as.which(),ri(1,2,3)), booltype)
36}
37\seealso{
38\code{\link{booltypes}}, \code{\link{is.booltype}}, \code{\link{as.booltype}}
39}
40