aboutsummaryrefslogtreecommitdiff
path: root/R/pkg
diff options
context:
space:
mode:
authorfelixcheung <felixcheung_m@hotmail.com>2015-10-20 21:40:22 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-10-20 21:40:22 -0700
commit1107bd958aefc793d6e8e369ad6268b24a0f8510 (patch)
tree152bda24326b416523e5a741fbeb517685cb25cc /R/pkg
parent135ade905089fe90d3cc9e84f8fedc7637e901d8 (diff)
downloadspark-1107bd958aefc793d6e8e369ad6268b24a0f8510.tar.gz
spark-1107bd958aefc793d6e8e369ad6268b24a0f8510.tar.bz2
spark-1107bd958aefc793d6e8e369ad6268b24a0f8510.zip
[SPARK-11221][SPARKR] fix R doc for lit and add examples
Currently the documentation for `lit` is inconsistent with doc format, references "Scala symbol" and has no example. Fixing that. shivaram Author: felixcheung <felixcheung_m@hotmail.com> Closes #9187 from felixcheung/rlit.
Diffstat (limited to 'R/pkg')
-rw-r--r--R/pkg/R/functions.R13
1 files changed, 9 insertions, 4 deletions
diff --git a/R/pkg/R/functions.R b/R/pkg/R/functions.R
index a220ad8b9f..a72fb7bb42 100644
--- a/R/pkg/R/functions.R
+++ b/R/pkg/R/functions.R
@@ -18,16 +18,21 @@
#' @include generics.R column.R
NULL
-#' Creates a \code{Column} of literal value.
+#' lit
#'
-#' The passed in object is returned directly if it is already a \linkS4class{Column}.
-#' If the object is a Scala Symbol, it is converted into a \linkS4class{Column} also.
-#' Otherwise, a new \linkS4class{Column} is created to represent the literal value.
+#' A new \linkS4class{Column} is created to represent the literal value.
+#' If the parameter is a \linkS4class{Column}, it is returned unchanged.
#'
#' @family normal_funcs
#' @rdname lit
#' @name lit
#' @export
+#' @examples
+#' \dontrun{
+#' lit(df$name)
+#' select(df, lit("x"))
+#' select(df, lit("2015-01-01"))
+#'}
setMethod("lit", signature("ANY"),
function(x) {
jc <- callJStatic("org.apache.spark.sql.functions",