| := | R Documentation |
Functions like new_class() and new_generic() take a name that, by
convention, matches the name of the variable that you assign their result
to. The := operator eliminates this duplication: Foo := new_class() is
equivalent to Foo <- new_class(name = "Foo").
:= works with any function that has a name argument, but bear in mind
that it adds name to the call as a named argument, so any other arguments
supplied positionally will shift to fill the remaining parameters.
lhs := rhs
lhs |
A bare symbol: both the name of the variable to create and the
|
rhs |
A call to a function with a |
The result of evaluating rhs, which is also assigned to lhs in
the calling environment, returned invisibly.
Range := new_class(properties = list(
start = class_double,
end = class_double
))
Range
describe := new_generic("x")
describe
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.