xyz=data.frame(name=c("a","b","a","b",
"a","b")
,maths=c(7,8,NA,NA,NA,NA)
,science=c(NA,NA,6,8,NA,NA)
,history=c(NA,NA,NA,NA,6,7))
How can I removed NAs from the above dataframe?
Here is the expected output:
xyz=data.frame(name=c("a","b")
,maths=c(7,8)
,science=c(6,8)
,history=c(6,7))