Returns the modal state of a variable, e.g., the modal state in a sequence.
rowmode(v, except = NULL)
A numerical or factor variable.
Vector of values that should be ignored; e.g., set except="*" to ignore missing states with default coding.
except="*"
The modal value
The function tabulates the variable and returns the most frequent value.
table.
table
# NOT RUN { data(actcal) actcal.seq <- seqdef(actcal[1:10,13:24]) actcal.mod <- apply(as.matrix(actcal.seq), 1, rowmode) head(actcal.mod) # }
Run the code above in your browser using DataLab