如何处理R

时间:2016-03-18 11:05:39

标签: r list combinations large-data-volumes

我最近问了一个关于如何在列表中的数据帧上应用函数的问题。在此,我展示了链接,它完美地执行了帖子中收到的答案。

Apply a function to a List of dataframes in R

在此示例中,列表中只有两个大小为6x6的数据帧。

当我尝试复制列表的输出时,出现以下错误。

Error in matrix(r, nrow = len.r, ncol = count) : 
 invalid 'ncol' value (too large or NA)
 In addition: Warning message:
 In combn(unique(x$id), 2) : NAs introduced by coercion to integer range

我的列表基本上是一个大数据框2328439 signatures of 11 variables,分为多个框,列出Large list 6236 elements, 3.5Gb

我基本上想要将它们的所有可能组合配对并将它们并排比较,但由于它很大,我决定尝试对它们进行分组,因此数据被分成块,这些块是不同的数据帧。配对。

如果我们考虑signatures数据框,在将其划分为块之前,它将是这样的:

> ids <- combn(unique(signatures$uniqueid),2)
Error in combn(unique(signatures$uniqueid), 2) : n < m

所以这段代码适用于一个小数据集,(参考:R Generate non repeating pairs in dataframe)但是当我在我的大数据框架上尝试它时,我得到了上一个错误。

有什么建议吗?

0 个答案:

没有答案