| select {SparkR} | R Documentation |
Selects a set of columns with names or Column expressions.
select(x, col, ...) selectExpr(x, expr, ...) ## S4 method for signature 'SparkDataFrame' x$name ## S4 replacement method for signature 'SparkDataFrame' x$name <- value ## S4 method for signature 'SparkDataFrame,character' select(x, col, ...) ## S4 method for signature 'SparkDataFrame,Column' select(x, col, ...) ## S4 method for signature 'SparkDataFrame,list' select(x, col)
x |
A SparkDataFrame |
col |
A list of columns or single Column or name |
A new SparkDataFrame with selected columns
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, filter,
first, group_by,
head, histogram,
insertInto, intersect,
isLocal, join,
limit, merge,
mutate, ncol,
persist, printSchema,
registerTempTable, rename,
repartition, sample,
saveAsTable, selectExpr,
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, filter,
first, group_by,
head, histogram,
insertInto, intersect,
isLocal, join,
limit, merge,
mutate, ncol,
persist, printSchema,
registerTempTable, rename,
repartition, sample,
saveAsTable, selectExpr,
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, filter,
first, group_by,
head, histogram,
insertInto, intersect,
isLocal, join,
limit, merge,
mutate, ncol,
persist, printSchema,
registerTempTable, rename,
repartition, sample,
saveAsTable, selectExpr,
showDF, show,
str, take,
unionAll, unpersist,
withColumn, write.df,
write.jdbc, write.json,
write.parquet, write.text
Other subsetting functions: [[,
filter
## 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[,df$age]
## End(Not run)