frozenSet: frozenSet: flatten a set into a hash key (or more generally,...

Description Usage Arguments Value Author(s) Examples

Description

The sole functionality of the frozenset() class in Dendrix appeared to be as a hashable key, so this function simply replicates that functionality in R.

Usage

1
  frozenSet(set)

Arguments

set

A collapsible object, typically a vector or Vector.

sep

The character to separate items in the serialized object. Default is |.

Value

A string, with the entries sorted in alphabetical order.

Author(s)

Tim Triche, Jr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
  ## instead of |
  separator = ' '

  ## pickle a random sample of letters into a hashable key 
  foo = frozenSet( letters[ sample(1:26, 10) ], sep=separator )

  ## now recover the original (sorted, de-duplicated) sample
  bar = strsplit( foo, separator, fixed=TRUE )[[1]]

  ## and print it
  print(bar)

ttriche/dendRix documentation built on June 1, 2019, 2:50 a.m.