On Wednesday 09 August 2006 18:31, Dimitris Rizopoulos wrote: > try this: > > fun1 <- function(x) { > environment(fun2) <- environment() > ifelse(somecondition, bb <- "o", bb <- "*") > ## mymatrix is created, then > myresult <- apply(mymatrix, 1, fun2) > }
Beautiful :) Thanks very much Dimitris, I was out of energy after several hours of struggling with this. Best, Adrian -- Adrian Dusa Romanian Social Data Archive 1, Schitu Magureanu Bd 050025 Bucharest sector 5 Romania Tel./Fax: +40 21 3126618 \ +40 21 3120210 / int.101 ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.