Reputation: 89
I need to feed an R code with a vector from an external source and be fast, so I want to avoid reading generic files, such as csv. I thought that writing outside R a RDS file could be a good idea.
Is there any library or wrapper in C, C++, Python, Perl able to write in RDS format?
P.S. If you know a better way, other than RDS, suggestions are welcome.
Upvotes: 2
Views: 5626
Reputation: 363
You could use rpy2 in Python. I use the following in python3:
import pandas as pd
import rpy2.robjects as robjects
saveRDS = robjects.r['saveRDS']
saveRDS(pd_dataframe, 'data.rds')
Upvotes: 2