Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 将多个矩阵导入R中的一个数组_Arrays_R_Matrix - Fatal编程技术网

Arrays 将多个矩阵导入R中的一个数组

Arrays 将多个矩阵导入R中的一个数组,arrays,r,matrix,Arrays,R,Matrix,我有一个文件夹,其中有24个单独的文件夹。每个文件夹都包含多个文件,每个文件都包含一个矩阵。如何循环遍历各个文件夹并拉出选定的文件并将其放入阵列中?例如,如果我有一个中心文件夹,其中我有24个文件夹,并且在24个文件夹中的每个文件夹中都有名为file1、file2、file3的文件,那么如何提取每个file1并将它们放入阵列中 他们每人10乘10是的。其中一个回答问我是否可以开始一个新的问题。 files <- list.files(path="/path/to/your/folder/"

我有一个文件夹,其中有24个单独的文件夹。每个文件夹都包含多个文件,每个文件都包含一个矩阵。如何循环遍历各个文件夹并拉出选定的文件并将其放入阵列中?例如,如果我有一个中心文件夹,其中我有24个文件夹,并且在24个文件夹中的每个文件夹中都有名为file1、file2、file3的文件,那么如何提取每个file1并将它们放入阵列中

他们每人10乘10是的。其中一个回答问我是否可以开始一个新的问题。
files <- list.files(path="/path/to/your/folder/")
require(abind)
arr <- do.call( abind, lapply(seq_along(list.files) , function(finum) {
                    data.matrix( read.table(file=files[finum],  ,,,devilish details) )
                    }
files <- list.files(path="/path/to/your/folder/")
require(abind)
arr <- do.call( abind, lapply(list.files , function(filnm) {
                    data.matrix( read.table(file=filnm,  ,,, devilish details) )