Displaying 1 result from an estimated 1 matches for "resultdf4".
Did you mean:
resultdf
2010 Sep 09
0
Fast / dependable way to "stack together" data frames from a list
...ace in one shot and then fill it in.
## I got this algorithm from code in the
## "complete" function in the "mice" package.
## It allocates a big matrix of 0's and
## then it places the individual data frames into that matrix.
m <- 4
nr <- nrow(df1)
nc <- ncol(df1)
resultDF4 <- as.data.frame(matrix(0, nrow = nr*m, ncol = nc))
for (j in 1:m) resultDF4[(((j-1)*nr) + 1):(j*nr), ] <- mylist[[j]]
## This is a bit error prone for my taste. If the data frames have
## different numbers of rows, some major code surgery will be needed.
##
## Dennis Murphy pointed out th...