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@slot,x,envir=parent.env(environment())
}
assign_slot(x)
All I get from this is a new object with the name OBJECT@slot, the slot
assignment of OBJECT
On 11-06-03 5:03 PM, mcguirebc wrote:
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@slot,x,envir=parent.env(environment())
}
assign_slot(x)
All I get from this is a new object with the name
On 06/03/2011 02:03 PM, mcguirebc wrote:
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@slot,x,envir=parent.env(environment())
}
assign_slot(x)
All I get from this is a new object with the name