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.
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.