Github user actuaryzhang commented on a diff in the pull request:
https://github.com/apache/spark/pull/18422#discussion_r124719101
--- Diff: R/pkg/R/functions.R ---
@@ -132,23 +132,40 @@ NULL
#' df <- createDataFrame(as.data.frame(Titanic, stringsAsFactors = FALSE))}
NULL
-#' lit
+#' Non-aggregate functions for Column operations
#'
-#' A new \linkS4class{Column} is created to represent the literal value.
-#' If the parameter is a \linkS4class{Column}, it is returned unchanged.
+#' Non-aggregate functions defined for \code{Column}.
#'
-#' @param x a literal value or a Column.
+#' @param x Column to compute on. In \code{lit}, it is a literal value or
a Column.
+#' In \code{monotonically_increasing_id}, it should be empty.
+#' @param y Column to compute on.
+#' @param ... additional argument(s). In \code{expr}, it contains an
expression character
+#' object to be parsed.
+#' @name column_nonaggregate_functions
+#' @rdname column_nonaggregate_functions
+#' @seealso coalesce,SparkDataFrame-method
#' @family non-aggregate functions
-#' @rdname lit
-#' @name lit
+#' @examples
+#' \dontrun{
+#' # Dataframe used throughout this doc
+#' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))}
+NULL
+
+#' @details
+#' \code{lit}: A new \linkS4class{Column} is created to represent the
literal value.
+#' If the parameter is a \linkS4class{Column}, it is returned unchanged.
+#'
+#' @rdname column_nonaggregate_functions
#' @export
-#' @aliases lit,ANY-method
+#' @aliases lit lit,ANY-method
#' @examples
+#'
#' \dontrun{
-#' lit(df$name)
-#' select(df, lit("x"))
-#' select(df, lit("2015-01-01"))
-#'}
+#' tmp <- mutate(df, v1 = lit(df$mpg), v2 = lit("x"), v3 =
lit("2015-01-01"),
+#' v4 = negate(df$mpg), v5 = expr('length(model)'),
+#' v6 = greatest(df$vs, df$am), v7 = least(df$vs, df$am),
+#' v8 = column("mpg"))
--- End diff --
See L2796.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]