data$cens.type <- NA #crate column with NAs data$cens.type[data$type=="exact"] <- 1 #put 1 for every "exact" in column type