Displaying 1 result from an estimated 1 matches for "rmixnorm".
Did you mean:
dmixnorm
2023 May 25
4
environments: functions within functions
...e
wrapper function are no longer visible within the eval() call.
I have a two-part question:
A. How do I get around this right now?
B. What would the correct approach be for the package authors?
library(mixR)
# first example from ?mixfit
## fitting the normal mixture models
set.seed(103)
x <- rmixnormal(200, c(0.3, 0.7), c(2, 5), c(1, 1))
data <- bin(x, seq(-1, 8, 0.25))
fit1 <- mixfit(x, ncomp = 2) # raw data
rm(x, data)
###
# simple function
funworks <- function(x) {
print(x)
}
###
# almost identical simple function
funfails <- function(thisx) {
print(thisx)
}
###
fun...