在R中绘制非常大的数据集 [英] Plotting of very large data sets in R

查看:81
本文介绍了在R中绘制非常大的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在R中绘制非常大的数据集?

How can I plot a very large data set in R?

我想使用箱形图,小提琴图或类似图形.无法将所有数据放入内存中.我可以逐步阅读并计算绘制这些图所需的摘要吗?如果可以,怎么办?

I'd like to use a boxplot, or violin plot, or similar. All the data cannot be fit in memory. Can I incrementally read in and calculate the summaries needed to make these plots? If so how?

推荐答案

在我对

In supplement to my comment to Dmitri answer, a function to calculate quantiles using ff big-data handling package:

ffquantile<-function(ffv,qs=c(0,0.25,0.5,0.75,1),...){
 stopifnot(all(qs<=1 & qs>=0))
 ffsort(ffv,...)->ffvs
 j<-(qs*(length(ffv)-1))+1
 jf<-floor(j);ceiling(j)->jc
 rowSums(matrix(ffvs[c(jf,jc)],length(qs),2))/2
}

这是一种精确的算法,因此它使用排序-可能会花费很多时间.

This is an exact algorithm, so it uses sorting -- and thus may take a lot of time.

这篇关于在R中绘制非常大的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆