在R

问题描述 投票:0回答:1

我有一个大数据框架。其中很少有人是班级

1000 columns
,很少有班级
integer
,我想在所有列上运行
character
,并且尝试了几种方法,但是执行从未通过,最终我不得不中止R Studio。如何做? 我正在尝试遵循方式。
fisher test

instead
r dataframe
1个回答
0
投票
,尝试

combn

RcppAlgos::comboGeneral

data:

> tictoc::tic()
> r <- RcppAlgos::comboGeneral(names(MIBCMETAdf), 2, FUN=\(j, ...) {
+   unlist(fisher.test(table(MIBCMETAdf[, j]))[c("p.value", "estimate")])
+ }) |> do.call(what='rbind')
> tictoc::toc()
148.691 sec elapsed
> head(r)
       p.value estimate.odds ratio
[1,] 0.8437265           0.9174655
[2,] 0.1685111           1.7551113
[3,] 0.4261868           0.7149415
[4,] 0.5556475           1.2732325
[5,] 0.3126351           0.6215150
[6,] 0.4205574           1.4820226

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.