first {SparkR} | R Documentation |
Return the first row of a DataFrame
Aggregate function: returns the first value in a group.
## S4 method for signature 'DataFrame' first(x) ## S4 method for signature 'Column' first(x)
x |
A SparkSQL DataFrame |
Other agg_funcs: approxCountDistinct
,
approxCountDistinct
,
approxCountDistinct
; avg
,
avg
; countDistinct
,
countDistinct
, countDistinct
,
n_distinct
; count
,
count
, count
,
n
, nrow
; last
,
last
; max
;
mean
; min
;
sumDistinct
, sumDistinct
;
sum
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D first(df)
## End(Not run)
## Not run: first(df$c)