privefl / bigstatsr

R package for statistical tools with big matrices stored on disk.
https://privefl.github.io/bigstatsr/
179 stars 30 forks source link

How to use big_apply properly #175

Closed minhnd212 closed 2 weeks ago

minhnd212 commented 6 months ago

Hi, I wish to use the big_apply() function in the same manner as apply(). I went through the function's documentation and noticed that big_apply() applies to an a.FUN that calls another function that can perform calculations on a GROUP of columns, such as colSums(), rowSums(), etc., and which group of columns to be calculated are based on the ind argument.

However, my a.FUN calls another function that can perform calculations on ONE column at a time only (instead of a group of columns). I can program the function so that it can perform calculations on a group of columns by using a for loop, but then it defeats the purpose of using big_apply() or apply(), which is to avoid using the for loop, if I understand correctly.

Could you give me a suggestion on how I can go about solving this problem? Thank you.

privefl commented 6 months ago
minhnd212 commented 6 months ago

I am sorry for the late reply. I ran into the same problem that I wrote in the other post, which is to use the big_apply() function properly, so if I can get some more details on how to write the big_apply() function properly for what I am trying to do, I believe this issue will be resolved as well. Thank you

privefl commented 6 months ago

Please share what you've tried with big_apply(), we'll go from there.

privefl commented 5 months ago

Any update on this?