An array class.

Share:

Description

Like a list, but has some methods. Completely superflous, but makes copying some code algorithms easier. We implement methods such as append, push, pop and each for iteration. As well, there are some lookup methods.

Methods

contains(name)

TRUE if name is key in array

core()

return list

each(FUN, ...)

Iterator for lists, like sapply, but FUN gets passed index, key, and value

flush(...)

Reset array, return contents as list

get_by_name(name)

get item under name

get_id()

Return an id, or name, for an object

get_item(index)

Get item by index

len()

length

pluck(id, ...)

Like ext.pluck. Returns array with 'id' extracted from each item in the Array

push(x, name)

Append x with optional name. If name not specified new id created. Returns name

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.