One simple explanation for the error message you received is that you have a
typo: 'lapply' instead of 'apply':
x <- matrix(1:6, 2)
apply(x, 1, sum)
[1] 9 12
lapply(x, 1, sum)
Error in match.fun(FUN) : '1' is not a function, character or symbol
However, it's difficult to diagnose withou
On 7/04/2009, at 2:04 PM, Gang Chen wrote:
I've written a function, myFunc, that works fine with myFunc(data,
...), but when I use apply() to run it with an array of data
apply(myArray, 1, myFunc, ...)
I get a strange error:
Error in match.fun(FUN) : '1' is not a function, character or symbo
I've written a function, myFunc, that works fine with myFunc(data,
...), but when I use apply() to run it with an array of data
apply(myArray, 1, myFunc, ...)
I get a strange error:
Error in match.fun(FUN) : '1' is not a function, character or symbol
which really puzzles me because '1' is meant
3 matches
Mail list logo