RevolutionAnalytics / RHadoop

RHadoop
https://github.com/RevolutionAnalytics/RHadoop/wiki
763 stars 278 forks source link

store data in CSV format #234

Open simran-k opened 8 years ago

simran-k commented 8 years ago

I wrote the following function to write data in HDFS using R. I

writeToHDFS <- function(fileName){ hdfs.init() modelfile <- hdfs.file(fileName, "w") hdfs.write(get(fileName), modelfile) hdfs.close(modelfile) } How do I modify it store this data in CSV format instead?I have tried using pipe but since it is deprecated, I would like a way to write CSV files through hdfs.write functions.

I tried this:

modelfile <- hdfs.file(paste(fileName, "csv", sep="."), "w") but I do not think it creates a valid CSV but only appends the extension for it.