pub unsafe fn s4_set_slot(
obj: SEXP,
slot_name: &str,
value: SEXP,
) -> Result<(), String>Expand description
Set the value of a named slot on an S4 object.
Uses R’s slot(obj, name) <- value to assign the slot value.
§Safety
objmust be a valid S4 SEXP with the named slot.valuemust be a valid SEXP of the appropriate type for the slot.- Must be called from the R main thread.
§Returns
Ok(())on success.Err(String)if the slot doesn’t exist or the value type is incompatible.