Returns a new object of class
Class. If no other arguments are given, the object is a copy of the prototype from the class definition. Most classes have a generator function with the same name as the class that is likely to be more useful in most situations.
USAGE:
new
(
Class
,
...
)
REQUIRED ARGUMENTS:
Class
Name of the class from which to create an object.
OPTIONAL ARGUMENTS:
...
Named or unnamed arguments. Use named arguments to supply values for slots with the corresponding names. Use unnamed arguments to provide data to be coerced to the specified class. If the new class extends another class, an object from the extended class can be supplied, along with optional named arguments for any additional slots.
VALUE:
A new object of class
Class.
SEE ALSO:
,
EXAMPLES:
new("numeric") # returns prototype for the class
setClass("sequence", prototype = numeric(3)) # 3 numeric values represent start,
new("sequence", c(1, 51, 10)) # end, and step values of a sequence