numvecdict: Create a dictionary of numerical vectors.

Description Usage Value See Also Examples

View source: R/dict.R

Description

Returns a dictionary in which numbers and string (including vectors of each) can be used as keys. This dictionary can only store vectors of numbers.

Usage

1

Value

A dictionary object that can be used to assign and add values using either [[ operator or member functions accessed via $.

See Also

dict

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create dictionary
d <- numvecdict()

# assign new vector
d[[ c(2,3) ]] <- c(1:3)

# and add a number
d$append_number(c(2,3), 4)

# return values
d[[ c(2,3) ]]

# appending to a new key will create a new vector
d$append_number("new!", 42)

mkuhn/dict documentation built on May 23, 2019, 2:03 a.m.