Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

booltype

Diagnosing boolean types


Description

Specific methods for booltype are required, where non-unary methods can combine multiple bollean types, particularly boolean binary operators.

Usage

booltype(x)

Arguments

x

an R object

Details

Function booltype returns the boolean type of its argument. There are currently six boolean types, booltypes is an ordered vector with the following ordinal levels

nobool

non-boolean types

logical

for representing any boolean data including NA

bit

for representing dense boolean data

bitwhich

for representing sparse (skewed) boolean data

which

for representing sparse boolean data with few TRUE

ri

range-indexing, for representing sparse boolean data with a single range of TRUE

Value

one scalar element of booltypes in case of 'nobool' it carries a name attribute with the data type.

Note

do not rely on the internal integer codes of these levels, we might add-in hi later

See Also

Examples

unname(booltypes)
str(booltypes)
sapply(list(double(),integer(),logical(),bit(),bitwhich(),as.which(),ri(1,2,3)), booltype)

bit

Classes and Methods for Fast Memory-Efficient Boolean Selections

v4.0.4
GPL-2 | GPL-3
Authors
Jens Oehlschlägel [aut, cre], Brian Ripley [ctb]
Initial release
2020-08-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.