not {SparkR} | R Documentation |
Inversion of boolean expression.
Inversion of boolean expression.
not(x) ## S4 method for signature 'Column' !x ## S4 method for signature 'Column' not(x)
x |
Column to compute on |
not
and !
cannot be applied directly to numerical column.
To achieve R-like truthiness column has to be casted to BooleanType
.
! since 2.3.0
not since 2.3.0
Other non-aggregate functions:
column_nonaggregate_functions
,
column()
## Not run:
##D df <- createDataFrame(data.frame(x = c(-1, 0, 1)))
##D
##D head(select(df, !column("x") > 0))
## End(Not run)
## Not run:
##D df <- createDataFrame(data.frame(
##D is_true = c(TRUE, FALSE, NA),
##D flag = c(1, 0, 1)
##D ))
##D
##D head(select(df, not(df$is_true)))
##D
##D # Explicit cast is required when working with numeric column
##D head(select(df, not(cast(df$flag, "boolean"))))
## End(Not run)