dimΒΆ

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

Syntax:

  • dim(df)

Parameters:

  • df: Any SparkDataFrame

Output:

  • List
require(SparkR)

# Create SparkDataFrame
df <- createDataFrame(mtcars)
head(df)
# View dimensions of df (numRows, numCols)
dim(df)