limit,DataFrame,numeric-method {SparkR}R Documentation

Limit

Description

Limit the resulting DataFrame to the number of rows specified.

Usage

## S4 method for signature 'DataFrame,numeric'
limit(x, num)

limit(x, num)

Arguments

x

A SparkSQL DataFrame

num

The number of rows to return

Value

A new DataFrame containing the number of rows specified.

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D limitedDF <- limit(df, 10)
## End(Not run)

[Package SparkR version 1.4.1 Index]