【发布时间】:2020-02-18 11:33:43
【问题描述】:
我有多个包含表格形式数据的文件。我想生成一个 3 维数组,其中每个文件中的数据存储在第三维中。例如,如果我有 10 个文件,则第一个文件中的数据将存储在 3D 数组的第一层,第二个文件中的数据将存储在第二层,依此类推。
这是我正在使用的虚拟代码,但它不能正常工作。
# reading data from the file ( I have a list of files names as fname)
dataDum <- read.table(fname[i],header = F, sep =';', skip=121, stringsAsFactors = FALSE)
# Assigning data to the array. I have already generated an empty array with the desired dimension
finaldata[, , i]=dataDum
【问题讨论】: