Displaying 1 result from an estimated 1 matches for "assign_slot".
2011 Jun 03
2
S4 Slot assignment within function
Is there a simple way to assign values to S4 slots from within a function?
Doing this doesn't work:
> assign_slot<-function(x){
assign("OBJECT at slot",x,envir=parent.env(environment())
}
>assign_slot(x)
All I get from this is a new object with the name OBJECT at slot, the slot
assignment of OBJECT doesn't change.
I have thought about solutions such as eval(parse()) to pull this off, b...