key: Index Key Functions

View source: R/key.R

keyR Documentation

Index Key Functions

Description

Functions to assign, retrieve or check an index key for a given object.

Usage

key(x, ...)

Arguments

x

Object.

...

Other arguments (not used).

value

Character string(s) specifying the index key to be assigned.

Functions

key

Default key method.

key.default

Default format retrieval method. If no key attribute is defined, then a call to format is made.

key<-

Generic key assignment method. See Examples for usage.

key<-.default

Defaultkey assignment method. See Examples for usage.

is.key

Defaultis.key method.

is.key.data.frame

Check validity of an index key for a data.frame object.

See Also

metadata

Examples

# Build sample data:
x <- data.frame(year = 1990:2014, measurement = rpois(25, lambda = 5))
key(x) <- "year" # Assign key.
key(x) # Retrieve key.

is.key(x, "measurement") # Generally FALSE
is.key(x, "year")


TobieSurette/gulf.metadata documentation built on Dec. 31, 2022, 5:35 a.m.