values-methods: Get values from an object

Description Usage Arguments Value Examples

Description

Extracts the values from a data structure such as a map or heap object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
values(obj)

## S4 method for signature 'heap'
values(obj)

## S4 method for signature 'bimap'
values(obj)

## S4 method for signature 'unordered_map'
values(obj)

Arguments

obj

object to extract values from

Value

returns the extracted values as a list or, when primitive, as a vector. In case of a heap also returns key and handle of the heap node.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 # shows the values of a hashmap
 h_map <- hashmap("integer")
 h_map <- insert(h_map, seq(2), list(data.frame(a=1), 3))
 values(h_map)

 # shows the values of a multimap
 m_map <- multimap("integer")
 m_map[seq(2)] <- list(diag(2), rnorm(3))
 values(m_map)

 # shows the values of a heap
 f_heap <- fibonacci_heap("integer")
 f_heap <- insert(f_heap, 1:2, list(diag(2), rnorm(3)))
 values(f_heap)

datastructures documentation built on Aug. 10, 2020, 5:08 p.m.