attach,SparkDataFrame-method {SparkR}R Documentation

Attach SparkDataFrame to R search path


The specified SparkDataFrame is attached to the R search path. This means that the SparkDataFrame is searched by R when evaluating a variable, so columns in the SparkDataFrame can be accessed by simply giving their names.


## S4 method for signature 'SparkDataFrame'
attach(what, pos = 2L,
  name = deparse(substitute(what), backtick = FALSE), warn.conflicts = TRUE)



(SparkDataFrame) The SparkDataFrame to attach


(integer) Specify position in search() where to attach.


(character) Name to use for the attached SparkDataFrame. Names starting with package: are reserved for library.


(logical) If TRUE, warnings are printed about conflicts from attaching the database, unless that SparkDataFrame contains an object


attach since 1.6.0

See Also


Other SparkDataFrame functions: SparkDataFrame-class, agg, alias, arrange,, broadcast, cache, checkpoint, coalesce, collect, colnames, coltypes, createOrReplaceTempView, crossJoin, cube, dapplyCollect, dapply, describe, dim, distinct, dropDuplicates, dropna, drop, dtypes, except, explain, filter, first, gapplyCollect, gapply, getNumPartitions, group_by, head, hint, histogram, insertInto, intersect, isLocal, isStreaming, join, limit, localCheckpoint, merge, mutate, ncol, nrow, persist, printSchema, randomSplit, rbind, registerTempTable, rename, repartition, rollup, sample, saveAsTable, schema, selectExpr, select, showDF, show, storageLevel, str, subset, summary, take, toJSON, unionByName, union, unpersist, withColumn, withWatermark, with, write.df, write.jdbc, write.json, write.orc, write.parquet,, write.text


## Not run: 
##D attach(irisDf)
##D summary(Sepal_Width)
## End(Not run)

[Package SparkR version 2.3.1 Index]