[R] Exclude data using logical

pgseye prseye at gmail.com
Thu Mar 25 00:46:39 CET 2010


Hi,

I'm wanting to exclude data more than 2 sd's from the mean before proceeding
with further analyses. I've created new logical variables (a and b) and
written them to the existing dataframe. I want to be able to subset the TRUE
observations based on another 2 factor variable. I'm assuming this is
possible, but I don't know what I'm doing wrong, as I get results that
obviously aren't correct.

Many thanks,

Paul

twin.wide$a<-twin.wide$RCCT<600 & twin.wide$RCCT>480
twin.wide$b<-twin.wide$LCCT<600 & twin.wide$LCCT>480

selVarsCCT <- with(twin.wide,c('a','b'))

MZCCT <- subset(twin.wide,Zygosity=='MZ',selVarsCCT)
DZCCT <- subset(twin.wide,Zygosity=='DZ',selVarsCCT)
-- 
View this message in context: http://n4.nabble.com/Exclude-data-using-logical-tp1689992p1689992.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list