How to loop subset of lists in R?
问题 I have a list of 9 lists, see the following code where I want to loop only three lists p , r and t for Pearson, Spearson and Kendall correlations, respectively, instead of all 9 lists. The current pseudocode is the following where the test function is corrplot(M.cor, ...) , see below the complete pseudocode for (i in p.mat.all) { ... } Code with mtcars test data library("psych") library("corrplot") M <- mtcars M.cor <- cor(M) p.mat.all <- psych::corr.test(M.cor, method = c("pearson", "kendall