x <- factor(c("a","b","b","c","d"))
modal_category(x)
# in the case of ties, the first tie is returned
y <- factor(c("a","c","c","d","d"))
modal_category(y)
# both together, as an rvar
xy <- c(rvar(x), rvar(y))
xy
modal_category(xy)
Run the code above in your browser using DataLab