Re: [R] ifelse problem

2006-03-10 Thread Adrian DUSA
On Friday 10 March 2006 16:31, Uwe Ligges wrote: > [...] > aa[!(nchar(aa) < 3)] Thanks very much, I got it now. All the 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

Re: [R] ifelse problem

2006-03-10 Thread Uwe Ligges
Adrian DUSA wrote: > Dear all, > > There is something I'm missing in order to understand the following behavior: > > >>aa <- c("test", "name") >>ifelse(any(nchar(aa) < 3), aa[-which(nchar(aa) < 3)], aa) > [1] "test" > >>any(nchar(aa) < 3) > > [1] FALSE > > Shouldn't the ifelse function retu

[R] ifelse problem

2006-03-10 Thread Adrian DUSA
Dear all, There is something I'm missing in order to understand the following behavior: > aa <- c("test", "name") > ifelse(any(nchar(aa) < 3), aa[-which(nchar(aa) < 3)], aa) [1] "test" > any(nchar(aa) < 3) [1] FALSE Shouldn't the ifelse function return the whole aa vector? Using if and else sepa