min

min is an aggregate function that returns the minimum value in a column.

Syntax:

  • max(DataFrame$column)

Parameters:

  • DataFrame: Any SparkR DataFrame
  • column: Column in DataFrame

Output:

  • Column Object
# Create SparkR DataFrame using the faithful dataset from R
df <- createDataFrame(sqlContext, faithful)

# Displays the content of the DataFrame to stdout
head(df)
# Return first value of column df$waiting
collect(select(df, min(df$waiting)))