Skip to content
Prev 82812 / 398503 Next

Delete missing values

I am trying to delete rows containing missing values from a groupeddata object. Several of the columns are character (sexChar, HAPI, rs2304785) the rest are numeric. For some reason I am excluding all rows with missing values. Your suggestions for corrections would be appreciated.

This did not work
	GC2 <- GC[c("logtg" != NA & "ctime" != NA & !is.na("sexChar") & !is.na("HAPI") & "logfirsttg" != NA & "BMI" != NA & !is.na(GC$
		rs2304795)),  ] 
nor did
	GC2 <- GC["logtg" != NA & "ctime" != NA & !is.na("sexChar") & !is.na("HAPI") & "logfirsttg" != NA & "BMI" != NA & !is.na(GC$
		rs2304795),  ] 

John

John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of Medicine Claude Pepper OAIC

University of Maryland School of Medicine
Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524

410-605-7119 
- NOTE NEW EMAIL ADDRESS:
jsorkin at grecc.umaryland.edu