filter {SparkR} | R Documentation |
Filter the rows of a SparkDataFrame according to a given condition.
filter(x, condition) where(x, condition) ## S4 method for signature 'SparkDataFrame,characterOrColumn' filter(x, condition) ## S4 method for signature 'SparkDataFrame,characterOrColumn' where(x, condition)
x |
A SparkDataFrame to be sorted. |
condition |
The condition to filter on. This may either be a Column expression or a string containing a SQL statement |
A SparkDataFrame containing only the rows that meet the condition.
Other SparkDataFrame functions: SparkDataFrame-class
,
[[
, agg
,
arrange
, as.data.frame
,
attach
, cache
,
collect
, colnames
,
coltypes
, columns
,
count
, dapply
,
describe
, dim
,
distinct
, dropDuplicates
,
dropna
, drop
,
dtypes
, except
,
explain
, first
,
group_by
, head
,
histogram
, insertInto
,
intersect
, isLocal
,
join
, limit
,
merge
, mutate
,
ncol
, persist
,
printSchema
,
registerTempTable
, rename
,
repartition
, sample
,
saveAsTable
, selectExpr
,
select
, showDF
,
show
, str
,
take
, unionAll
,
unpersist
, withColumn
,
write.df
, write.jdbc
,
write.json
, write.parquet
,
write.text
Other SparkDataFrame functions: SparkDataFrame-class
,
[[
, agg
,
arrange
, as.data.frame
,
attach
, cache
,
collect
, colnames
,
coltypes
, columns
,
count
, dapply
,
describe
, dim
,
distinct
, dropDuplicates
,
dropna
, drop
,
dtypes
, except
,
explain
, first
,
group_by
, head
,
histogram
, insertInto
,
intersect
, isLocal
,
join
, limit
,
merge
, mutate
,
ncol
, persist
,
printSchema
,
registerTempTable
, rename
,
repartition
, sample
,
saveAsTable
, selectExpr
,
select
, showDF
,
show
, str
,
take
, unionAll
,
unpersist
, withColumn
,
write.df
, write.jdbc
,
write.json
, write.parquet
,
write.text
Other subsetting functions: [[
,
select
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- read.json(sqlContext, path)
##D filter(df, "col1 > 0")
##D filter(df, df$col2 != "abcdefg")
## End(Not run)