Message-ID: <A9F29369832FC5489130D24565FAA6B90143C6C86242@PL-EMSMB3.ees.hhs.gov>
Date: 2012-11-22T14:11:24Z
From: Muhuri, Pradip (SAMHSA/CBHSQ)
Subject: Data Extraction
Hello,
I would appreciate if someone could help me resolve the following:
1. df1[!is.na( X1 | X2 | X3 | X4 | X5),][,1:5] # This does not work
2. Is these message harmful? The following object(s) are masked from 'df1 (position 3)':
X1, X2, X3, X4, X5
Thanks,
Pradip Muhuri
#Reproducible Example
set.seed(5)
df1<-data.frame(matrix(sample(c(1:10,NA),100,replace=TRUE),ncol=5))
attach (df1)
#delete rows if any of them NA for X1
df1[!is.na( X1),][,1:5] # This works
#delete rows if any of them NA for X1, X2, X3, X4 or X5
df1[!is.na( X1 | X2 | X3 | X4 | X5),][,1:5] # This does not work