privefl / bigstatsr

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

Is there a function similar to rbind(), cbind() but for FBM objects #174

Closed minhnd212 closed 7 months ago

minhnd212 commented 8 months ago

Hi, I was wondering if there is a function similar to rbind() and cbind() but for FBM objects instead of the usual matrices. I can write a program to do that using big_transpose(), big_copy(), but it will create many unwanted residual .bk files, which could take up lots of disk spaces for big FBM objects. Thank you

privefl commented 8 months ago

You can use X$add_columns() to expand the number of columns, which will also increase the size of the file on disk. However, it is not possible to do this for adding rows.

minhnd212 commented 7 months ago

I think it is possible to add rows by adding columns to the transpose matrix using big_transpose() then perform the transpose again. But then, I ran into the same issue of filling a matrix with the content of another matrix, which I posted in another threat. So, if that issue is resolved, this issue will be resolved as well. I apologize for writing multiple threads for similar issues. I will be more mindful of that next time.