.set is an internal method for assigning key-value pairs to a
hash. Normally, there is no need to use this function.
Convenient access is provided by:
hash, \$, [ and [[ and their
corresponding replacement methods.
.set takes 4 types of arguments:
explicitly named key and value vectors
named key-value pairs
implicit key-value pairs
The keys are automatically coerced to valid keys and are restricted to character classes. Values are free to be any valid R object.
An hash object on which to set the key-value pair(s)
Any of several ways to specify keys and values. See Details.
.set sets zero or more key-value pairs. If the key(s) already
exist, existing values are silently clobbered. Otherwise, a new
value is saved for each key. Keys and values are by the
made only of explicitly named
arguments then these are taken as the keys and values respectively.
a named list, then the names are taken as keys and list elements are taken as values.
a named vector, then the names are taken as keys. Vector elements are taken as values.
of length two, keys are taken from the first element, values from the second.
Keys are coerced to type
Keys and values are assigned to the hash as follows:
values are the same length, key-value
pairs are added to the hash pairwise.
keys is a vector of length 1, then this key is assigned
values is a vector of length 1, each key of
is assigned the value given by
values are of different lengths, both
greater than one, then the assignment is considered ambiguous and
an error is thrown.
.set exists solely for its side-effects. An invisible NULL is
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.