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) {
> 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
>
>
>
>
> --
> Christoph Lehmann <[EMAIL PROTECTED]>
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments,...{{dropped}}
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html