Research Article
Community-Based Decision Making and Priority Setting Using the R Software: The Community Priority Index
LikertCheck = function(data, likert) | | ### 1. replace all NA with 0 | data[is.na(data[,3]),3] = 0 | data[is.na(data[,4]),4] = 0 | ### 2. replace all inappropriate answers with 0 | data[,3:4] = data[,3:4](data[,3:4] > 0)(data[,3:4]<=likert) | ### 3. Replace all 0 with NA | data[(data[,3] == 0),3] = NA | data[(data[,4] == 0),4] = NA | data | |
|