Skip to contents

Limit the resulting SparkDataFrame to the number of rows specified.

Usage

limit(x, num)

# S4 method for class 'SparkDataFrame,numeric'
limit(x, num)

Arguments

x

A SparkDataFrame

num

The number of rows to return

Value

A new SparkDataFrame containing the number of rows specified.

Note

limit since 1.4.0

Examples

if (FALSE) { # \dontrun{
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
limitedDF <- limit(df, 10)
} # }