Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个生成数据表的小函数。然后,我希望R多次复制这个函数,所以我将我的函数包含在一个“replicate()”函数中。这似乎工作得很好。
现在,我想将每个模拟的结果保存在一个表中。我尝试过 rbind、data.table 等...但显然我做错了。
replicate(100,{object<-function{.... results<-(table of results) }})
我不知道我是否理解正确,但对我来说最简单的事情是使用一些条件函数。例如:
i<-1 main.table<-data.frame() while (i<=100) { object<-function (...) main.table<-rbind(main.table,object) i<-i+1 }