lists <- lapply(vector("list", 5), function(x) sample(1:100,50,replace=T))
How can i extract all values which are present in at least n (2,3,4,5) vectors inside lists
(or generally in a population of vectors)?
For n=5, this question gives already a solution (e.g. intersect()
), but is unclear to me for cases of n < m.
In this particular case, i perform 5 variants of mean-comparisons between two groups, and want to extract a consensus between the 5 tests (e.g. significantly different in at least 3 tests).