dim

dim returns the dimensions of a DataFrame in the format: numRows, numColumns

Syntax:

  • dim(df)

Parameters:

  • df: Any SparkR DataFrame

Output:

  • List
# Create SparkR DataFrame
df <- createDataFrame(sqlContext, mtcars)
head(df)
# View dimensions of df (numRows, numCols)
dim(df)