我试图将列表组合起来创建一个矩阵:
#reading all spreadsheets
genes <- read_excel("RNA.xlsx", range = "A3:B56321")
huh <- as.double(read_excel("RNA.xlsx", range = "LX3:LX56321"))
snu <- read_excel("RNA.xlsx", range = "AGS3:AGS56321")
#creating a data frame
df <- matrix(nrow=nrow(huh),ncol=4)
for(i in 1:nrow(huh)){
df[i,1] <- genes[i,1]
df[i,2] <- genes[i,2]
df[i,3] <- as.integer(huh[i,1])
df[i,4] <- as.integer(snu[i,4])
}
我得到的错误:
df [i,1]&lt; - genes [i,1]中的错误:下标数量不正确 基质
任何解决方案?