Convert rds to csv in r. csv, the object stored should be a data frame