Skip to content
Prev 317685 / 398502 Next

Iterating through slots of an S4 object

On 13-02-15 6:14 PM, Scott Robinson wrote:
See ?slotNames.  For example,

for (slot in slotNames(x)) {
   cat(slot, ":\n")
   print(slot(x, slot))
}

Duncan Murdoch