Making Microwave Ovens
To make an object, you create a factory, then call its new() method. Note that you don't need to define this method; all factories have a new() method by default.
a_thing <- thing_factory$new()
यह अभ्यास पाठ्यक्रम का हिस्सा है
Object-Oriented Programming with S3 and R6 in R
अभ्यास निर्देश
The microwave_oven_factory variable from the last exercise is in your workspace.
- View the
microwave_oven_factory. - Create a new
MicrowaveOvenobject and assign it to the variablemicrowave_oven.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# View the microwave_oven_factory
microwave_oven_factory
# Make a new microwave oven
microwave_oven <- ___