Do you have an idea to call only one specific matrix which contain a string of characters in my list of twelve matrices ? For exemple, I have my list of twelve matrices (which represent data of genetic distance between pairs of 60 individuals, a matrix is therefore 60*60) for the 12 months of the year, and I want to extract only 3 matrices for 3 months of the year.
So for that, I want to call the matrices which contain in their name "Apr", "May" or "Jun", like this : spring <- list(list.mat[["Apr"]], list.mat[["May"]], list.mat[["Jun"]])
. But because there is missing months, I want to find a function who call only the months who can possibly contain these string of charactrs in their names. I try grep
function and its derivates but it doesn't work on list of matrices...
I know there is a simple way to do that but I don't know which way to look!
我不想手工制作,因为我有超过40个12个矩阵的列表!
如果你知道我在找什么,谢谢你的回复