Description Usage Arguments Value Note See Also Examples
Returns a new SparkDataFrame or a Column with an alias set. Equivalent to SQL "AS" keyword.
1 2 3 4 5 |
object |
x a SparkDataFrame or a Column |
data |
new name to use |
a SparkDataFrame or a Column
alias(Column) since 1.4.0
alias(SparkDataFrame) since 2.3.0
Other column_func:
between()
,
cast()
,
endsWith()
,
otherwise()
,
over()
,
startsWith()
,
substr()
Other SparkDataFrame functions:
SparkDataFrame-class
,
agg()
,
arrange()
,
as.data.frame()
,
attach,SparkDataFrame-method
,
broadcast()
,
cache()
,
checkpoint()
,
coalesce()
,
collect()
,
colnames()
,
coltypes()
,
createOrReplaceTempView()
,
crossJoin()
,
cube()
,
dapplyCollect()
,
dapply()
,
describe()
,
dim()
,
distinct()
,
dropDuplicates()
,
dropna()
,
drop()
,
dtypes()
,
exceptAll()
,
except()
,
explain()
,
filter()
,
first()
,
gapplyCollect()
,
gapply()
,
getNumPartitions()
,
group_by()
,
head()
,
hint()
,
histogram()
,
insertInto()
,
intersectAll()
,
intersect()
,
isLocal()
,
isStreaming()
,
join()
,
limit()
,
localCheckpoint()
,
merge()
,
mutate()
,
ncol()
,
nrow()
,
persist()
,
printSchema()
,
randomSplit()
,
rbind()
,
rename()
,
repartitionByRange()
,
repartition()
,
rollup()
,
sample()
,
saveAsTable()
,
schema()
,
selectExpr()
,
select()
,
showDF()
,
show()
,
storageLevel()
,
str()
,
subset()
,
summary()
,
take()
,
toJSON()
,
unionAll()
,
unionByName()
,
union()
,
unpersist()
,
withColumn()
,
withWatermark()
,
with()
,
write.df()
,
write.jdbc()
,
write.json()
,
write.orc()
,
write.parquet()
,
write.stream()
,
write.text()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
df <- createDataFrame(iris)
head(select(
df, alias(df$Sepal_Length, "slength"), alias(df$Petal_Length, "plength")
))
## End(Not run)
## Not run:
df <- alias(createDataFrame(mtcars), "mtcars")
avg_mpg <- alias(agg(groupBy(df, df$cyl), avg(df$mpg)), "avg_mpg")
head(select(df, column("mtcars.mpg")))
head(join(df, avg_mpg, column("mtcars.cyl") == column("avg_mpg.cyl")))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.