recode_nr {ShinyItemAnalysis} | R Documentation |
recode_nr()
function recognizes and recodes not-reached
responses, i.e., missing responses to items such that all subsequent
items are missed as well by the respondent.
recode_nr(Data, nr_code = 99, df)
Data |
matrix or data.frame: object to be recoded, must include only items columns and no additional information |
nr_code |
single character, integer or numeric: specifying how should be
recognized not-reached responses coded (default is |
df |
deprecated. Use argument |
A data.frame
object.
Jan Netik
Institute of Computer Science of the Czech Academy of Sciences
netik@cs.cas.cz
Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz
HCImissed <- HCI[, 1:20] # simulate skipped (missed) and not-reached items in HCI dataset set.seed(4211) for (i in 1:150) { # not-reached (minimum at 10th item, maximum at 20th) HCImissed[sample(1:nrow(HCImissed), 1), seq(sample(10:20, 1), 20)] <- NA # missed with random location HCImissed[sample(1:nrow(HCImissed), 1), sample(1:20, 1)] <- NA } summary(HCImissed) HCImissedNR <- recode_nr(HCImissed, nr_code = 99) head(HCImissedNR) summary(HCImissedNR)