| conflate | R Documentation |
conflate combines methods for any S3 standard generic allowing arguments
of various methods to be specified in a single function that it returns.
conflate(generic_spec)
generic_spec |
[ |
Function with additional class conflate with arguments being
conflate_func(generic_spec_args, ..., evaluate = TRUE)
Where ... specifies additional arguments to be supplied in the form
object_class.arg. The evaluate argument is useful for debugging purposes.
The generic_spec argument is the generic function as applied to
shared arguments between methods that are to be combined. Once this is
decided, all additional arguments passed to the generated function need to
be of the form object_class.arg that are arguments unique to each method
as dispatched for each object class.
Other function assemblers:
convoke()
# first construct two models
glm.model <- glm(Sepal.Length ~ Sepal.Width, data = iris)
lm.model <- lm(Sepal.Length ~ Sepal.Width, data = iris)
# create summary with extra object arguments using `conflate`
(conflated_summary <- conflate(summary(x)))
purrr::map(
list(glm.model, lm.model),
~ conflated_summary(.,
lm.correlation = TRUE, glm.correlation = TRUE,
glm.symbolic.cor = TRUE
)
)
# alternatively, you could supply `correlation` as a default in conflate itself
(conflated_summary <- conflate(summary(x, correlation = TRUE)))
purrr::map(
list(glm.model, lm.model),
~ conflated_summary(., lm.symbolic.cor = TRUE)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.