traversc / qs

Quick serialization of R objects
397 stars 19 forks source link

NEW FEATURE: Load specific columns in data.frame like objects #100

Closed randrescastaneda closed 3 months ago

randrescastaneda commented 3 months ago

Hi @traversc ,

It would be great to have an argument in qread() that allows the user to specify which columns they want to load. Something similar to the columns argument in the fst::fst_read() function. Of course, given that qs works for any type of object, including lists, the argument should check whether or not the object that is intended to be loaded is of class data.frame. Also, if the object is a simple list, this argument could work to load particular elements of the list.

Anyway, this is just an idea. If I knew C++, I would have happily contributed 😉

Thank you so much for this great package!

traversc commented 3 months ago

Hi @randrescastaneda thanks for your feedback! This has been asked before, but unfortunately because it needs to work for arbitrary objects and not just dataframes it's not possible to implement sensibly in qs.

fst is a great package and if you need just data.frames I highly recommend it. Another package you might look into for dataframes is arrow which has this feature and also has python compatibility.