Github user felixcheung commented on a diff in the pull request: https://github.com/apache/spark/pull/8864#discussion_r40624779 --- Diff: R/pkg/R/DataFrame.R --- @@ -946,15 +946,36 @@ setMethod("foreachPartition", ############################## SELECT ################################## -getColumn <- function(x, c) { - column(callJMethod(x@sdf, "col", c)) -} +#' Select a column +#' +#' Selects column based on the column name and return it as a Column. +#' Note that the column name can also reference to a nested column like `a.b`. +#' +#' @param x A SparkSQL DataFrame +#' +#' @rdname select +#' @name col +#' @aliases col +#' @export +#' @examples +#'\dontrun{ +#' sc <- sparkR.init() +#' sqlContext <- sparkRSQL.init(sc) +#' df <- createDataFrame(sqlContext, list(50, 60, 70), "age") +#' col(df, "age") +#'} +setMethod("col", --- End diff -- `col` in R seems to be unrelated to this. https://stat.ethz.ch/R-manual/R-devel/library/base/html/col.html `Returns a matrix of integers indicating their column number in a matrix-like object, or a factor of column labels.`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org