
20 R Programming for Bioinformatics
2.2.4.3 Environments
An environment is a set of symbol-value pairs, where the value can be any R
object, and hence they are much like lists. Originally environments were used
for R’s internal evaluation model. They have slowly been exposed as an R
version of a hash table, or an associative array. The internal implementation
is in fact that of a hash table. The symbol is used to compute the hash index,
and the hash index is used to retrieve the value. In the code below, we create
an environment, create the symbol value pair that relates the symbol a to the
value 10 and then list the contents of the hash table.
> e1