hasKey: hasKey

Description Usage Arguments Value Examples

View source: R/hasKey.R

Description

Checks if a specific index exists

Usage

1
hasKey(x, ...)

Arguments

x

listArray object

...

index to check

Value

logical: TRUE index exists, FALSE index exists not

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
l <- listArray()
l[1] <- 1
hasKey(l, 1)
l[2,3] <- "test"
hasKey(l, 2, 3)
l[2:3] <- "vector"
hasKey(l, 2:3)
l['iris'] <- iris
hasKey(l, iris) # FALSE
l[mean] <- mean
hasKey(l, mean)
# if you have not stored NULL objects in your listArray
is.null(l[mean])
is.null(l[iris])

listArray documentation built on Sept. 13, 2020, 5:19 p.m.