typeCheck: Check the type of an object

Description Usage Arguments Details Value Examples

Description

Check the type of an object

Usage

1
2
3

Arguments

x

An object

Details

is.altrep : Is an object ALTREP?

is.altWrapper : Is an object altWrapper?

Value

Logical value indicating whether the object is an ALTREP

Logical value indicating whether the object is an altWrapper

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## An R vector is not ALTREP nor altWrapper.
x=runif(10)
is.altrep(x)
is.altWrapper(x)

## A compact sequence is ALTREP but not altWrapper.
x=1:10
is.altrep(x)
is.altWrapper(x)

## An altWrapper object is also an ALTREP object
length_func <- function(x) length(x)
setAltClass(className = "example", classType = "integer")
setAltMethod(className = "example", getLength = length_func)
A <- newAltrep(className = "example", x = 1L:10L)
is.altrep(x)
is.altWrapper(A)

Jiefei-Wang/AltWrapper documentation built on Oct. 30, 2019, 7:43 p.m.