[R] Elementary Help

arun smartpink111 at yahoo.com
Tue Jun 18 16:32:56 CEST 2013


Hi,
May be this helps:
set.seed(24)
dat1<- data.frame(ID=1:200,value=sample(c(5:200,NA),200,replace=TRUE))
 which(is.na(dat1$value))
#[1]  56 146 184
sum(which(is.na(dat1$value)))  #Not clear about the 2nd part of the question
#[1] 386

 sum(is.na(dat1$value))
#[1] 3
table(is.na(dat1$value))
#FALSE  TRUE 
#  197     3 
A.K.


>I am totally new to R, therefore probably this question will be very 
easy for most of you. I have a range of values in a column ranging from 5 to 200. >Some of the values are missing, that is, not all student 
numbers are there. How do I find which are these missing numbers and 
obtain the sum of >these integers?



More information about the R-help mailing list