Learn R Programming

hash (version 3.0.1)

set: set -assign key-value pair(s) to a hash

Description

.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, $, [, [[, values and their corresponding replacement methods.

Usage

.set(hash, ...)

Arguments

Value

.set exists solely for its side-effects. An invisible NULL is returned.

See Also

hash, environment

Examples

Run this code
h <- hash()

  hash:::.set( h, keys=letters, values=1:26 )
  hash:::.set( h, a="foo", b="bar", c="baz" )
  hash:::.set( h, c( aa="foo", ab="bar", ac="baz" ) )
  clear(h)
  hash:::.set( h, letters, values )

Run the code above in your browser using DataLab