Learn R Programming

listArray (version 0.1.1)

hasKey: hasKey

Description

Checks if a specific index exists

Usage

hasKey(x, ...)

Arguments

x

listArray object

...

index to check

Value

logical: TRUE index exists, FALSE index exists not

Examples

Run this code
# NOT RUN {
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])
# }

Run the code above in your browser using DataLab