Dear all,
I was recently contacted by a user about an alledged problem/bug in
the latest version of lasso2. After some investigation, we found out
that it was a user error which boils down to the following:
x <- matrix(rnorm(200), ncol=2)
var <- "fred"
apply(x, 2, var)
Error in get(x, envir, mode, inherits) : variable "fred" of mode "function" was not found
only that the "offending" apply() command happened inside the gl1ce()
function of lasso2.
I was under the impression that R can now distinguish between
variables and functions with the same name and, indeed, the following
works:
var <- 2
apply(x, 2, var)
[1] 1.053002 1.250875
Poking a bit around, I guess that the ability to distinguish between
variables and functions with the same name comes from the introduction
of the function match.fun() and, after reading its help page, the