Description Usage Arguments Details Value Examples
View source: R/isClassConstructor.R
takes a function and returns a boolean indicating whether its output gets assigned a class.
1 | isClassConstructor(func)
|
func |
any function |
The body of func
is search for one of three idioms:
UseMethod("className")
class(output) <- classes
attr(output, "class") <- classes
If either is found, the assigned class (or classes) are returned as the
classes
attribute of the output. If none are found, a value of
FALSE
is returned (with no attributes).
a boolean. If the return value is TRUE
the boolean has
attribute classes
which returns the (potential) classes for the
output of func
1 2 3 4 5 6 7 8 9 | isClassConstructor(mean) # FALSE
# simple output
library(randomForest)
isClassConstructor(randomForest) # TRUE
# complicated output (multiple values in "classes")
isClassConstructor(glm) # TRUE
isClassConstructor(lm) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.