filter {SparkR} | R Documentation |
Filter the rows of a DataFrame according to a given condition.
## S4 method for signature 'DataFrame,characterOrColumn' filter(x, condition) ## S4 method for signature 'DataFrame,characterOrColumn' where(x, condition) filter(x, condition) where(x, condition)
x |
A DataFrame to be sorted. |
condition |
The condition to filter on. This may either be a Column expression or a string containing a SQL statement |
A DataFrame containing only the rows that meet the condition.
Other subsetting functions: $
,
$<-
, select
,
select
,
select,DataFrame,Column-method
,
select,DataFrame,list-method
,
selectExpr
; [
,
[
, [
, [[
,
subset
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D filter(df, "col1 > 0")
##D filter(df, df$col2 != "abcdefg")
## End(Not run)