$ {SparkR} | R Documentation |
Selects a set of columns with names or Column expressions.
## 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) select(x, col, ...)
x |
a SparkDataFrame. |
name |
name of a Column (without being wrapped by |
value |
a Column or an atomic vector in the length of 1 as literal value, or |
col |
a list of columns or single Column or name. |
... |
additional column(s) if only one column is specified in |
A new SparkDataFrame with selected columns.
$ since 1.4.0
$<- since 1.4.0
select(SparkDataFrame, character) since 1.4.0
select(SparkDataFrame, Column) since 1.4.0
select(SparkDataFrame, list) since 1.4.0
Other SparkDataFrame functions: SparkDataFrame-class
;
[
, [,SparkDataFrame-method
,
[[
,
[[,SparkDataFrame,numericOrcharacter-method
,
[[<-
,
[[<-,SparkDataFrame,numericOrcharacter-method
,
subset
, subset
,
subset,SparkDataFrame-method
;
agg
, agg
, agg
,
agg,GroupedData-method
,
agg,SparkDataFrame-method
,
summarize
, summarize
,
summarize
,
summarize,GroupedData-method
,
summarize,SparkDataFrame-method
;
arrange
, arrange
,
arrange
,
arrange,SparkDataFrame,Column-method
,
arrange,SparkDataFrame,character-method
,
orderBy,SparkDataFrame,characterOrColumn-method
;
as.data.frame
,
as.data.frame,SparkDataFrame-method
;
attach
,
attach,SparkDataFrame-method
;
cache
, cache
,
cache,SparkDataFrame-method
;
checkpoint
, checkpoint
,
checkpoint,SparkDataFrame-method
;
coalesce
, coalesce
,
coalesce
,
coalesce,Column-method
,
coalesce,SparkDataFrame-method
;
collect
, collect
,
collect,SparkDataFrame-method
;
colnames
, colnames
,
colnames,SparkDataFrame-method
,
colnames<-
, colnames<-
,
colnames<-,SparkDataFrame-method
,
columns
, columns
,
columns,SparkDataFrame-method
,
names
,
names,SparkDataFrame-method
,
names<-
,
names<-,SparkDataFrame-method
;
coltypes
, coltypes
,
coltypes,SparkDataFrame-method
,
coltypes<-
, coltypes<-
,
coltypes<-,SparkDataFrame,character-method
;
count,SparkDataFrame-method
,
nrow
, nrow
,
nrow,SparkDataFrame-method
;
createOrReplaceTempView
,
createOrReplaceTempView
,
createOrReplaceTempView,SparkDataFrame,character-method
;
crossJoin
,
crossJoin,SparkDataFrame,SparkDataFrame-method
;
dapplyCollect
, dapplyCollect
,
dapplyCollect,SparkDataFrame,function-method
;
dapply
, dapply
,
dapply,SparkDataFrame,function,structType-method
;
describe
, describe
,
describe
,
describe,SparkDataFrame,ANY-method
,
describe,SparkDataFrame,character-method
,
describe,SparkDataFrame-method
,
summary
, summary
,
summary,SparkDataFrame-method
;
dim
,
dim,SparkDataFrame-method
;
distinct
, distinct
,
distinct,SparkDataFrame-method
,
unique
,
unique,SparkDataFrame-method
;
dropDuplicates
,
dropDuplicates
,
dropDuplicates,SparkDataFrame-method
;
dropna
, dropna
,
dropna,SparkDataFrame-method
,
fillna
, fillna
,
fillna,SparkDataFrame-method
,
na.omit
, na.omit
,
na.omit,SparkDataFrame-method
;
drop
, drop
,
drop
, drop,ANY-method
,
drop,SparkDataFrame-method
;
dtypes
, dtypes
,
dtypes,SparkDataFrame-method
;
except
, except
,
except,SparkDataFrame,SparkDataFrame-method
;
explain
, explain
,
explain
,
explain,SparkDataFrame-method
,
explain,StreamingQuery-method
;
filter
, filter
,
filter,SparkDataFrame,characterOrColumn-method
,
where
, where
,
where,SparkDataFrame,characterOrColumn-method
;
first
, first
,
first
,
first,SparkDataFrame-method
,
first,characterOrColumn-method
;
gapplyCollect
, gapplyCollect
,
gapplyCollect
,
gapplyCollect,GroupedData-method
,
gapplyCollect,SparkDataFrame-method
;
gapply
, gapply
,
gapply
,
gapply,GroupedData-method
,
gapply,SparkDataFrame-method
;
getNumPartitions
,
getNumPartitions,SparkDataFrame-method
;
groupBy
, groupBy
,
groupBy,SparkDataFrame-method
,
group_by
, group_by
,
group_by,SparkDataFrame-method
;
head
,
head,SparkDataFrame-method
;
hint
, hint
,
hint,SparkDataFrame,character-method
;
histogram
,
histogram,SparkDataFrame,characterOrColumn-method
;
insertInto
, insertInto
,
insertInto,SparkDataFrame,character-method
;
intersect
, intersect
,
intersect,SparkDataFrame,SparkDataFrame-method
;
isLocal
, isLocal
,
isLocal,SparkDataFrame-method
;
isStreaming
, isStreaming
,
isStreaming,SparkDataFrame-method
;
join
,
join,SparkDataFrame,SparkDataFrame-method
;
limit
, limit
,
limit,SparkDataFrame,numeric-method
;
merge
, merge
,
merge,SparkDataFrame,SparkDataFrame-method
;
mutate
, mutate
,
mutate,SparkDataFrame-method
,
transform
, transform
,
transform,SparkDataFrame-method
;
ncol
,
ncol,SparkDataFrame-method
;
persist
, persist
,
persist,SparkDataFrame,character-method
;
printSchema
, printSchema
,
printSchema,SparkDataFrame-method
;
randomSplit
, randomSplit
,
randomSplit,SparkDataFrame,numeric-method
;
rbind
, rbind
,
rbind,SparkDataFrame-method
;
registerTempTable
,
registerTempTable
,
registerTempTable,SparkDataFrame,character-method
;
rename
, rename
,
rename,SparkDataFrame-method
,
withColumnRenamed
,
withColumnRenamed
,
withColumnRenamed,SparkDataFrame,character,character-method
;
repartition
, repartition
,
repartition,SparkDataFrame-method
;
sample
, sample
,
sample,SparkDataFrame,logical,numeric-method
,
sample_frac
, sample_frac
,
sample_frac,SparkDataFrame,logical,numeric-method
;
saveAsParquetFile
,
saveAsParquetFile
,
saveAsParquetFile,SparkDataFrame,character-method
,
write.parquet
, write.parquet
,
write.parquet,SparkDataFrame,character-method
;
saveAsTable
, saveAsTable
,
saveAsTable,SparkDataFrame,character-method
;
saveDF
, saveDF
,
saveDF,SparkDataFrame,character-method
,
write.df
, write.df
,
write.df
,
write.df,SparkDataFrame-method
;
schema
, schema
,
schema,SparkDataFrame-method
;
selectExpr
, selectExpr
,
selectExpr,SparkDataFrame,character-method
;
showDF
, showDF
,
showDF,SparkDataFrame-method
;
show
, show
,
show,Column-method
,
show,GroupedData-method
,
show,SparkDataFrame-method
,
show,StreamingQuery-method
,
show,WindowSpec-method
;
storageLevel
,
storageLevel,SparkDataFrame-method
;
str
,
str,SparkDataFrame-method
;
take
, take
,
take,SparkDataFrame,numeric-method
;
toJSON
,
toJSON,SparkDataFrame-method
;
union
, union
,
union,SparkDataFrame,SparkDataFrame-method
,
unionAll
, unionAll
,
unionAll,SparkDataFrame,SparkDataFrame-method
;
unpersist
, unpersist
,
unpersist,SparkDataFrame-method
;
withColumn
, withColumn
,
withColumn,SparkDataFrame,character-method
;
with
,
with,SparkDataFrame-method
;
write.jdbc
, write.jdbc
,
write.jdbc,SparkDataFrame,character,character-method
;
write.json
, write.json
,
write.json,SparkDataFrame,character-method
;
write.orc
, write.orc
,
write.orc,SparkDataFrame,character-method
;
write.stream
, write.stream
,
write.stream,SparkDataFrame-method
;
write.text
, write.text
,
write.text,SparkDataFrame,character-method
Other subsetting functions: [
,
[,SparkDataFrame-method
, [[
,
[[,SparkDataFrame,numericOrcharacter-method
,
[[<-
,
[[<-,SparkDataFrame,numericOrcharacter-method
,
subset
, subset
,
subset,SparkDataFrame-method
;
filter
, filter
,
filter,SparkDataFrame,characterOrColumn-method
,
where
, where
,
where,SparkDataFrame,characterOrColumn-method
## 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)