我有一个大数据框架。其中很少有人是班级
1000 columns
,很少有班级integer
,我想在所有列上运行character
,并且尝试了几种方法,但是执行从未通过,最终我不得不中止R Studio。如何做?
我正在尝试遵循方式。
fisher test
insteadcombn
。
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