Displaying 2 results from an estimated 2 matches for "mixfitem".
2023 May 25
1
environments: functions within functions
? Thu, 25 May 2023 10:18:13 -0400
Sarah Goslee <sarah.goslee at gmail.com> ?????:
> print called on this object gets passed to print.mixfitEM(), which is:
>
>
> function (x, digits = getOption("digits"), ...)
> {
> family <- x$family
> mc <- match.call()
> mc$digits <- digits
> fun.name <- paste0("print", family)
> mc[[1]] <- as.name(fun.name)
> ev...
2023 May 25
4
environments: functions within functions
...data)
###
# simple function
funworks <- function(x) {
print(x)
}
###
# almost identical simple function
funfails <- function(thisx) {
print(thisx)
}
###
funworks(fit1)
funfails(fit1)
#######
The explanation as I understand it...
print called on this object gets passed to print.mixfitEM(), which is:
function (x, digits = getOption("digits"), ...)
{
family <- x$family
mc <- match.call()
mc$digits <- digits
fun.name <- paste0("print", family)
mc[[1]] <- as.name(fun.name)
eval(mc, environment())
}
Working through the call...