Extract values of a hash object.
values from a
hash object. This is a pseudo-
accessor method that returns hash values (without keys) as a
vector if possible, a list otherwise.
simplifies them to the lowest order (c.f. simplify). It is
very similar to
h[[ keys(h) ]] , An optional
key. It is identical to
h[[ keys(h) ]] .
For details about hash accessors, please see
1 2 3 4
A vector of keys to be returned.
Arguments passed to
For the replacement method, the value(s) to be set.
values method returns the values from a hash. It is
h[[ keys(h) ]] except that a named vector or list
is returned instead of a hash.
By default, the returned values are simplified by coercing to
a vector or matrix if possible; 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. Argument
simplify can be used to control this behavior.
If a character vector of
keys is provided, only these keys
are returned. This also allows for returning values mulitple times
values(h, keys=c('a','a','b' ) )
This is now the preferred method for returning multiple values for the same key.
The replacement method,
values<- can replace all the values or
simply those associated with the supplied
keys. Use of the
accessor '[' is almost always preferred.
Please see details for which value will be returned:
Vector with the type as the values of the hash
list containing the values of the hash
1 2 3 4 5 6 7 8 9 10 11
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.