Hi
It seems, I just miss something. I defined
treshold - function(pred) {
if (pred 0.5) pred - 0 else pred - 1
return(pred)
}
and want to use apply it on a vector
sapply(mylist[,,3],threshold)
but I get:
Error in match.fun(FUN) : Object threshold not found
thanks for help
cheers
chris
On Thu, 2004-02-26 at 11:39, Christoph Lehmann wrote:
Hi
It seems, I just miss something. I defined
treshold - function(pred) {
if (pred 0.5) pred - 0 else pred - 1
return(pred)
}
and want to use apply it on a vector
sapply(mylist[,,3],threshold)
but I get:
Error in
treshold - function(pred) {
Error in match.fun(FUN) : Object threshold not found
^
If this is a direct cut paste, you have a typo as you've defined the
function as treshold.
__
[EMAIL
That should be `threshold', not `treshold'. Is that the problem?
In any case, why not just use ifelse(); e.g., ifelse(mylist[,,3] .5, 0,
1)? Or even just round(mylist[,,3])?
Andy
From: Christoph Lehmann
Hi
It seems, I just miss something. I defined
treshold - function(pred) {