ron-r
2/23/2014 - 10:09 AM

Using If in R

Using If in R

dat <- transform(dat, Missing = as.integer(is.na(response)))

onther If stamtment:

cdata$TtlSessTime_HalfHour<-ifelse(cdata$TtlSessTime_Hour>0.5,1,0)

From http://stackoverflow.com/questions/20220156/create-a-new-binary-answer-column-in-my-data-based-on-na-values