.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 ...
argument. If ...
is:
made only of explicitly named keys
and values
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 character
.
Keys and values are assigned to the hash as follows:
IF keys
and values
are the same length, key-value
pairs are added to the hash pairwise.
IF keys
is a vector of length 1, then this key is assigned
the entire values
vector.
IF values
is a vector of length 1, each key of keys
is assigned the value given by values
IF keys
and values
are of different lengths, both
greater than one, then the assignment is considered ambiguous and
an error is thrown.