subsetting_hashtables | R Documentation |
hashset
s and hashmap
sSubsetting operators `[[`
and `[`
for
hashset
s and hashmap
s provide an equivalent synthax for the
basic read/write operations performed by insert()
,
delete()
and query()
.
## S3 method for class 'r2r_hashmap'
x[[i]]
## S3 method for class 'r2r_hashmap'
x[i]
## S3 replacement method for class 'r2r_hashmap'
x[[i]] <- value
## S3 replacement method for class 'r2r_hashmap'
x[i] <- value
## S3 method for class 'r2r_hashset'
x[[i]]
## S3 method for class 'r2r_hashset'
x[i]
## S3 replacement method for class 'r2r_hashset'
x[[i]] <- value
## S3 replacement method for class 'r2r_hashset'
x[i] <- value
x |
an |
i |
for |
value |
for |
the replacement forms ([[<-
and [<-
) always return value
.
`[[`
returns TRUE
or FALSE
if
x
is an hashset
, an arbitrary R object if x
is an
hashmap
and i
is a valid key; when i
is not a key, the
behaviour for hashmap
s depends on the value of
on_missing_key(x)
.
The `[`
operator returns a list of the same length of i
, whose
k-th element is given by x[[ i[[k]] ]]
(the remark on missing keys for
hashmaps applies also here).
Valerio Gherardi
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.