比 cumquant 更有效的计算累积分位数的方法是什么?
我正在尝试计算大型数据集(超过 1000 万)中某一列的累积分位数(10 个百分点、25 个百分点等)。
我尝试使用 cumstats 包中的函数 cumquant,但需要很长时间(超过一个小时;玩具测试表明,需要 40 秒以上才能获得具有 100,000 个值的向量的结果(例如cumquant(1:100000,p=0.1)
)。
是否有更有效的方法使用 data.table
(或其他)来计算它?
I'm trying to calculate the cumulative quantile (10 percentile, 25 percentile, etc.) over a column in a large dataset (over 10 million).
I tried to use the function cumquant
from the cumstats package but it takes long (longer than an hour; a toy test shows that it takes more than 40 seconds to obtain results for a vector with 100,000 values (e.g. cumquant(1:100000,p=0.1)
).
Is there a more efficient way to calculate it using data.table
(or others)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论