-
I do have a list of elements in
ab,ab <- list("M","O","E","P","Q","S","T","N","V","R") -
In other list
tb, is a list of 2*2 tables like,Sample data set,
n <- c("M", "N", "O") tb <- lapply(1:10, function(i)matrix(sample(4), 2, 2, dimnames=list(n[sample(3,2)], n[sample(3,2)]))) names(tb) <- paste(1:10) -
We only need to filter those tables in which the rowname of 1st table in the list
tbhas 1st element in the listab, 2nd table has 2nd element and so on. The number of elements in both listabandtbare the same. -
How will I match the rownames of the tables in the list with the list of elements?
I do have a list of elements in ab , ab <- list(M,O,E,P,Q,S,T,N,V,R) In
Share
Most of those ab-letters were not in the NMO list so I just checked to see if I were missing some:
But ab[8] = “N” is not in the rownames of tb[[8]]