有办法做到这一点吗?
我被这个卡住了:
m <- 10 # nof row
n <- 5 # nof column
# We will fill each cell with '0'
all <-c()
for (i in 1:m) {
row_i <- c(rep(0,n))
all <- c(all,row_i)
}它只创建1行作为输出。
发布于 2012-05-11 12:30:50
这将生成以零填充的data.frame。
as.data.frame(lapply(structure(.Data=1:N,.Names=1:N),function(x) numeric(M)))https://stackoverflow.com/questions/10544442
复制相似问题