nrowΒΆ

nrow returns the number of rows in a SparkDataFrame

Syntax:

  • nrow(df)

Parameters:

  • df: Any SparkDataFrame

Output:

  • List
require(SparkR)

# Create SparkDataFrame
df <- createDataFrame(mtcars)
head(df)
# View number of rows in df
nrow(df)