RevolutionAnalytics / RHadoop

RHadoop

Home Page:https://github.com/RevolutionAnalytics/RHadoop/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

store data in CSV format

simran-k opened this issue · comments

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.