arrange,DataFrame,characterOrColumn-method {SparkR} | R Documentation |
Sort a DataFrame by the specified column(s).
## S4 method for signature 'DataFrame,characterOrColumn' arrange(x, col, ...) ## S4 method for signature 'DataFrame,characterOrColumn' orderBy(x, col) arrange(x, col, ...) orderBy(x, col)
x |
A DataFrame to be sorted. |
col |
Either a Column object or character vector indicating the field to sort on |
... |
Additional sorting fields |
A DataFrame where all elements are sorted.
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D arrange(df, df$col1)
##D arrange(df, "col1")
##D arrange(df, asc(df$col1), desc(abs(df$col2)))
## End(Not run)