[R] Subsetting from data.frame

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri Nov 29 11:35:28 CET 2002



Christian Schulz wrote:
> 
> Hi,
> 
> attach(data)
> 
> if (TREUE[TREUE ==11] && EMPFEHL[EMPFEHL < 11])
> { TREUE <- EMPFEHL }
> 
> what's wrong ( TREUE ==EMPFEHL works not,too )?
> 
> many thanks & regards,Christian

Neither if() nor "&&" works vectorized, use ifelse() and "&" instead
(see the help pages for details).

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list