Learn R Programming

hash (version 1.0.3)

values: 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

Value

Please see details for which value will be returned:vectorVector with the type as the values of the hashlistlist containing the values of the hash

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.

References

none

See Also

See also hash, sapply.

Examples

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

Run the code above in your browser using DataLab