Evaluate a R expression in an environment constructed from a SparkDataFrame with() allows access to columns of a SparkDataFrame by simply referring to their name. It appends every column of a SparkDataFrame into a new environment. Then, the given expression is evaluated in this new environment.
with(data, expr, ...)# S4 method for SparkDataFrame
with(data, expr, ...)
(SparkDataFrame) SparkDataFrame to use for constructing an environment.
(expression) Expression to evaluate.
arguments to be passed to future methods.
Other SparkDataFrame functions: SparkDataFrame-class,
agg, arrange,
as.data.frame, attach,
cache, coalesce,
collect, colnames,
coltypes,
createOrReplaceTempView,
crossJoin, dapplyCollect,
dapply, describe,
dim, distinct,
dropDuplicates, dropna,
drop, dtypes,
except, explain,
filter, first,
gapplyCollect, gapply,
getNumPartitions, group_by,
head, histogram,
insertInto, intersect,
isLocal, join,
limit, merge,
mutate, ncol,
nrow, persist,
printSchema, randomSplit,
rbind, registerTempTable,
rename, repartition,
sample, saveAsTable,
schema, selectExpr,
select, showDF,
show, storageLevel,
str, subset,
take, union,
unpersist, withColumn,
write.df, write.jdbc,
write.json, write.orc,
write.parquet, write.text
# NOT RUN {
with(irisDf, nrow(Sepal_Width))
# }
Run the code above in your browser using DataLab