JaimeCr JaimeCr - 2 months ago 23x
R Question

How to convert SparkR DataFrame to RDD

I know how to convert a text file into an RDD with SparkR:

data <- textFile(sc, "data/tsv_wiki")

But I would want to know how to convert an object of type DataFrame in R to an RDD.

Any help would be appreciated.


It couldn't be easier.

converted.rdd <- SparkR:::toRDD(dataframe)

Note the triple colon operator, meaning that it's an internal function.