$ {SparkR} | R Documentation |
Selects a set of columns with names or Column expressions.
## S4 method for signature 'DataFrame' x$name ## S4 replacement method for signature 'DataFrame' x$name <- value ## S4 method for signature 'DataFrame,character' select(x, col, ...) ## S4 method for signature 'DataFrame,Column' select(x, col, ...) ## S4 method for signature 'DataFrame,list' select(x, col) select(x, col, ...) selectExpr(x, expr, ...)
x |
A DataFrame |
col |
A list of columns or single Column or name |
A new DataFrame with selected columns
Other subsetting functions: [
,
[
, [
, [[
,
subset
; filter
,
filter
, where
,
where
## Not run:
##D select(df, "*")
##D select(df, "col1", "col2")
##D select(df, df$name, df$age + 1)
##D select(df, c("col1", "col2"))
##D select(df, list(df$name, df$age + 1))
##D # Similar to R data frames columns can also be selected using `$`
##D df$age
## End(Not run)