Advanced
R
Q95 / 100
In R6 or Reference Classes (R5), what makes objects behave differently from standard S3/S4 objects with respect to method calls modifying state?
Correct! Well done.
Incorrect.
The correct answer is B) R6/Reference Class objects have reference (mutable) semantics, so calling a method that modifies a field changes the object in place without needing reassignment
B
Correct Answer
R6/Reference Class objects have reference (mutable) semantics, so calling a method that modifies a field changes the object in place without needing reassignment
Explanation
Unlike most R objects which use copy-on-modify semantics, R6 and Reference Class (R5) objects are mutable and modified in place by their methods, similar to objects in languages like Python or Java.
Progress
95/100