newTuple {gaggle} | R Documentation |
Gaggle Tuples are lists of key/value pairs which can be nested. These functions support creation of tuple objects for broadcast to other Gaggle-connected software or conversion of tuples to R list objects.
The function getTupleAsList receives a Gaggle Tuple broadcast by converting the received value to a list. This is an alternative to the older getTuple which returns an environment object.
newTuple(name, list=NULL) newSingle(name, value) addSingle(tuple, name=NULL, value=NULL, single=NULL) tupleToList(tuple) getTupleAsList()
name |
name to be assigned to the tuple or individual value |
list |
a list of items to be converted to Singles and added to the tuple |
value |
the value of a key/value pair |
tuple |
a java tuple object |
single |
a java single object |
t <- newTuple('sequence', list(name='chromosome', length=2014239)) s <- newSingle('topology', 'circular') addSingle(t, single=s) addSingle(t, name='color', 'blue') tupleToList(t) # expected output: # $name # [1] "chromosome" # $length # [1] 2014239 # $topology # [1] "circular" # $color # [1] "blue"