如何从R中的数据集中取出1万个样本?
我想从具有2000行的数据框架中取出400个样本,而这样做的方法只是
s1 <- sample_n(t, 400)
我想做10000次。我猜boot()是在这里使用的功能以避免过载,但我不知道我需要写些什么作为功能部分来获得我想要的东西,
boot(t, ?, 10000)
任何人都可以在这里帮助我吗?
I want to take a sample of 400 out of a data frame with 2000 rows, the way to do that is simply
s1 <- sample_n(t, 400)
Now I want to do that 10000 times. I guess boot() is the function to use here to avoid an overload but I don't know what I need to write as the function part to get what I want
boot(t, ?, 10000)
Can anyone more experienced with r help me out here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还可以使用
sample_n
重复<代码>重复像这样的随机示例:请注意:将10到10000更改为10000次。
随机数据
You can also
replicate
the random sample usingsample_n
like this:Please note: change the 10 to 10000 for 10000 times.
Random data