如何让 do.call (namespace:base) 和 rbindlist (namespace:data.table) 表现相同。rbindlist 消除了因子水平,而 do.call 没有。下面显示问题
(dataList <- list(data.frame(f1=rep(c("a"), each=1),"c"=rnorm(2),"d"=rnorm(2)),
data.frame(f1=rep(c("b"), each=1),"c"=rnorm(2),"d"=rnorm(2))) )
(rbindlist.Data <- rbindlist(dataList)) # combines lists into ONE data.frame same as above
(do.call.Data <- do.call(rbind, dataList))