Closed GaborioSensata closed 2 years ago
nPreguntas <- length(preguntas) pregData <- espiriIntData %>% select(all_of(preguntas)) espiriIntData$perdidos <- apply(pregData, 1, function(y) sum(length(which(as.character(y) == "S99")))) espiriIntData$porPerd <- espiriIntData$perdidos/nPreguntas*100 espiriIntData <- espiriIntData %>% filter(porPerd<25) %>% select(-c("perdidos", "porPerd")) attr(espiriIntData, "numAfterMis") <- nrow(espiriIntData) attr(espiriIntData, "numFinal") <- nrow(espiriIntData)
Solved with : def79f4dcb228aea9b8a759657916061ef2ece29