Find the n most common values in a vector November 29, 2022 by Tarik I’m sure this is a duplicate, but the answer is simple: sort(table(variable),decreasing=TRUE)[1:3]