values {hash}R Documentation

Extract values of a hash object.

Description

Extract values from a hash object. This is a pseudo- accessor method that returns all of the values without requiring a key. It is identical to h[[ keys(h) ]] .

For details about hash accessors, please see hash-class

Usage

values(x, ...)

Arguments

x The hash from where the values retrieved
... Arguments passed to sapply

Details

The values method returns the values from a hash in the simplest form available.

Values are extracted using sapply so if the values are coerced to a vector or matrixs if possible and elements are named after the corresponding key. If the values are of different types or of a complex class than a named list is returned. Supply arguments to sapply can force this case.

Value

Please see details for which value will be returned:

vector Vector with the type as the values of the hash
list list containing the values of the hash

Author(s)

Christopher Brown

References

none

See Also

See also hash, sapply.

Examples


    h <- hash( letters, 1:26 )
    values(h)  # 1:26
    values(h, simplify = FALSE )
    values(h, USE.NAMES = FALSE )


[Package hash version 0.23 Index]