Hi,
Based on the information you provided, the solution should be the one I
provided earlier. Otherwise, I must have misunderstood your question. In your
first post, you mentioned the IDs range from 5:200. So, the question is not
clear.
dat1<- read.table(text="
timeSec pupilId pupilName
13
HI,
Probably, this is the case. It is better to provide a reproducible example
data as mentioned in the posting guide.
set.seed(24)
dat1<- data.frame(ID=c(1:3,5:8,10:14),value=sample(1:40,12,replace=TRUE))
IDs<- 1:14 #the possible ID list
setdiff(IDs,dat1$ID)
#[1] 4 9
length(setdiff(IDs,dat1$ID
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
3 matches
Mail list logo