Skip to contents

Returns a new SparkDataFrame with columns dropped. This is a no-op if schema doesn't contain column name(s).

Usage

drop(x, ...)

# S4 method for SparkDataFrame
drop(x, col)

# S4 method for ANY
drop(x)

Arguments

x

a SparkDataFrame.

...

further arguments to be passed to or from other methods.

col

a character vector of column names or a Column.

Value

A SparkDataFrame.

Note

drop since 2.0.0

Examples

if (FALSE) {
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
drop(df, "col1")
drop(df, c("col1", "col2"))
drop(df, df$col1)
}