Repository: spark
Updated Branches:
  refs/heads/master 2d686a19e -> e793bf248


[SPARK-20889][SPARKR] Grouped documentation for MATH column methods

## What changes were proposed in this pull request?

Grouped documentation for math column methods.

Author: actuaryzhang <actuaryzhan...@gmail.com>
Author: Wayne Zhang <actuaryzhan...@gmail.com>

Closes #18371 from actuaryzhang/sparkRDocMath.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e793bf24
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e793bf24
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e793bf24

Branch: refs/heads/master
Commit: e793bf248bc3c71b9664f26377bce06b0ffa97a7
Parents: 2d686a1
Author: actuaryzhang <actuaryzhan...@gmail.com>
Authored: Tue Jun 27 23:15:45 2017 -0700
Committer: Felix Cheung <felixche...@apache.org>
Committed: Tue Jun 27 23:15:45 2017 -0700

----------------------------------------------------------------------
 R/pkg/R/functions.R | 619 ++++++++++++++++-------------------------------
 R/pkg/R/generics.R  |  48 ++--
 2 files changed, 241 insertions(+), 426 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e793bf24/R/pkg/R/functions.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/functions.R b/R/pkg/R/functions.R
index 3102858..23ccdf9 100644
--- a/R/pkg/R/functions.R
+++ b/R/pkg/R/functions.R
@@ -86,6 +86,31 @@ NULL
 #' df <- createDataFrame(data.frame(time = as.POSIXct(dts), y = y))}
 NULL
 
+#' Math functions for Column operations
+#'
+#' Math functions defined for \code{Column}.
+#'
+#' @param x Column to compute on. In \code{shiftLeft}, \code{shiftRight} and 
\code{shiftRightUnsigned},
+#'          this is the number of bits to shift.
+#' @param y Column to compute on.
+#' @param ... additional argument(s).
+#' @name column_math_functions
+#' @rdname column_math_functions
+#' @family math functions
+#' @examples
+#' \dontrun{
+#' # Dataframe used throughout this doc
+#' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
+#' tmp <- mutate(df, v1 = log(df$mpg), v2 = cbrt(df$disp),
+#'                   v3 = bround(df$wt, 1), v4 = bin(df$cyl),
+#'                   v5 = hex(df$wt), v6 = toDegrees(df$gear),
+#'                   v7 = atan2(df$cyl, df$am), v8 = hypot(df$cyl, df$am),
+#'                   v9 = pmod(df$hp, df$cyl), v10 = shiftLeft(df$disp, 1),
+#'                   v11 = conv(df$hp, 10, 16), v12 = sign(df$vs - 0.5),
+#'                   v13 = sqrt(df$disp), v14 = ceil(df$wt))
+#' head(tmp)}
+NULL
+
 #' lit
 #'
 #' A new \linkS4class{Column} is created to represent the literal value.
@@ -112,18 +137,12 @@ setMethod("lit", signature("ANY"),
             column(jc)
           })
 
-#' abs
-#'
-#' Computes the absolute value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{abs}: Computes the absolute value.
 #'
-#' @rdname abs
-#' @name abs
-#' @family non-aggregate functions
+#' @rdname column_math_functions
 #' @export
-#' @examples \dontrun{abs(df$c)}
-#' @aliases abs,Column-method
+#' @aliases abs abs,Column-method
 #' @note abs since 1.5.0
 setMethod("abs",
           signature(x = "Column"),
@@ -132,19 +151,13 @@ setMethod("abs",
             column(jc)
           })
 
-#' acos
-#'
-#' Computes the cosine inverse of the given value; the returned angle is in 
the range
-#' 0.0 through pi.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{acos}: Computes the cosine inverse of the given value; the returned 
angle is in
+#' the range 0.0 through pi.
 #'
-#' @rdname acos
-#' @name acos
-#' @family math functions
+#' @rdname column_math_functions
 #' @export
-#' @examples \dontrun{acos(df$c)}
-#' @aliases acos,Column-method
+#' @aliases acos acos,Column-method
 #' @note acos since 1.5.0
 setMethod("acos",
           signature(x = "Column"),
@@ -196,19 +209,13 @@ setMethod("ascii",
             column(jc)
           })
 
-#' asin
-#'
-#' Computes the sine inverse of the given value; the returned angle is in the 
range
-#' -pi/2 through pi/2.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{asin}: Computes the sine inverse of the given value; the returned 
angle is in
+#' the range -pi/2 through pi/2.
 #'
-#' @rdname asin
-#' @name asin
-#' @family math functions
+#' @rdname column_math_functions
 #' @export
-#' @aliases asin,Column-method
-#' @examples \dontrun{asin(df$c)}
+#' @aliases asin asin,Column-method
 #' @note asin since 1.5.0
 setMethod("asin",
           signature(x = "Column"),
@@ -217,18 +224,12 @@ setMethod("asin",
             column(jc)
           })
 
-#' atan
-#'
-#' Computes the tangent inverse of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{atan}: Computes the tangent inverse of the given value.
 #'
-#' @rdname atan
-#' @name atan
-#' @family math functions
+#' @rdname column_math_functions
 #' @export
-#' @aliases atan,Column-method
-#' @examples \dontrun{atan(df$c)}
+#' @aliases atan atan,Column-method
 #' @note atan since 1.5.0
 setMethod("atan",
           signature(x = "Column"),
@@ -276,19 +277,13 @@ setMethod("base64",
             column(jc)
           })
 
-#' bin
-#'
-#' An expression that returns the string representation of the binary value of 
the given long
-#' column. For example, bin("12") returns "1100".
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{bin}: An expression that returns the string representation of the 
binary value
+#' of the given long column. For example, bin("12") returns "1100".
 #'
-#' @rdname bin
-#' @name bin
-#' @family math functions
+#' @rdname column_math_functions
 #' @export
-#' @aliases bin,Column-method
-#' @examples \dontrun{bin(df$c)}
+#' @aliases bin bin,Column-method
 #' @note bin since 1.5.0
 setMethod("bin",
           signature(x = "Column"),
@@ -317,18 +312,12 @@ setMethod("bitwiseNOT",
             column(jc)
           })
 
-#' cbrt
-#'
-#' Computes the cube-root of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{cbrt}: Computes the cube-root of the given value.
 #'
-#' @rdname cbrt
-#' @name cbrt
-#' @family math functions
+#' @rdname column_math_functions
 #' @export
-#' @aliases cbrt,Column-method
-#' @examples \dontrun{cbrt(df$c)}
+#' @aliases cbrt cbrt,Column-method
 #' @note cbrt since 1.4.0
 setMethod("cbrt",
           signature(x = "Column"),
@@ -337,18 +326,12 @@ setMethod("cbrt",
             column(jc)
           })
 
-#' Computes the ceiling of the given value
-#'
-#' Computes the ceiling of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{ceil}: Computes the ceiling of the given value.
 #'
-#' @rdname ceil
-#' @name ceil
-#' @family math functions
+#' @rdname column_math_functions
 #' @export
-#' @aliases ceil,Column-method
-#' @examples \dontrun{ceil(df$c)}
+#' @aliases ceil ceil,Column-method
 #' @note ceil since 1.5.0
 setMethod("ceil",
           signature(x = "Column"),
@@ -357,6 +340,19 @@ setMethod("ceil",
             column(jc)
           })
 
+#' @details
+#' \code{ceiling}: Alias for \code{ceil}.
+#'
+#' @rdname column_math_functions
+#' @aliases ceiling ceiling,Column-method
+#' @export
+#' @note ceiling since 1.5.0
+setMethod("ceiling",
+          signature(x = "Column"),
+          function(x) {
+            ceil(x)
+          })
+
 #' Returns the first column that is not NA
 #'
 #' Returns the first column that is not NA, or NA if all inputs are.
@@ -405,6 +401,7 @@ setMethod("column",
           function(x) {
             col(x)
           })
+
 #' corr
 #'
 #' Computes the Pearson Correlation Coefficient for two Columns.
@@ -493,18 +490,12 @@ setMethod("covar_pop", signature(col1 = 
"characterOrColumn", col2 = "characterOr
             column(jc)
           })
 
-#' cos
-#'
-#' Computes the cosine of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{cos}: Computes the cosine of the given value.
 #'
-#' @rdname cos
-#' @name cos
-#' @family math functions
-#' @aliases cos,Column-method
+#' @rdname column_math_functions
+#' @aliases cos cos,Column-method
 #' @export
-#' @examples \dontrun{cos(df$c)}
 #' @note cos since 1.5.0
 setMethod("cos",
           signature(x = "Column"),
@@ -513,18 +504,12 @@ setMethod("cos",
             column(jc)
           })
 
-#' cosh
-#'
-#' Computes the hyperbolic cosine of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{cosh}: Computes the hyperbolic cosine of the given value.
 #'
-#' @rdname cosh
-#' @name cosh
-#' @family math functions
-#' @aliases cosh,Column-method
+#' @rdname column_math_functions
+#' @aliases cosh cosh,Column-method
 #' @export
-#' @examples \dontrun{cosh(df$c)}
 #' @note cosh since 1.5.0
 setMethod("cosh",
           signature(x = "Column"),
@@ -679,18 +664,12 @@ setMethod("encode",
             column(jc)
           })
 
-#' exp
-#'
-#' Computes the exponential of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{exp}: Computes the exponential of the given value.
 #'
-#' @rdname exp
-#' @name exp
-#' @family math functions
-#' @aliases exp,Column-method
+#' @rdname column_math_functions
+#' @aliases exp exp,Column-method
 #' @export
-#' @examples \dontrun{exp(df$c)}
 #' @note exp since 1.5.0
 setMethod("exp",
           signature(x = "Column"),
@@ -699,18 +678,12 @@ setMethod("exp",
             column(jc)
           })
 
-#' expm1
-#'
-#' Computes the exponential of the given value minus one.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{expm1}: Computes the exponential of the given value minus one.
 #'
-#' @rdname expm1
-#' @name expm1
-#' @aliases expm1,Column-method
-#' @family math functions
+#' @rdname column_math_functions
+#' @aliases expm1 expm1,Column-method
 #' @export
-#' @examples \dontrun{expm1(df$c)}
 #' @note expm1 since 1.5.0
 setMethod("expm1",
           signature(x = "Column"),
@@ -719,18 +692,12 @@ setMethod("expm1",
             column(jc)
           })
 
-#' factorial
-#'
-#' Computes the factorial of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{factorial}: Computes the factorial of the given value.
 #'
-#' @rdname factorial
-#' @name factorial
-#' @aliases factorial,Column-method
-#' @family math functions
+#' @rdname column_math_functions
+#' @aliases factorial factorial,Column-method
 #' @export
-#' @examples \dontrun{factorial(df$c)}
 #' @note factorial since 1.5.0
 setMethod("factorial",
           signature(x = "Column"),
@@ -772,18 +739,12 @@ setMethod("first",
             column(jc)
           })
 
-#' floor
-#'
-#' Computes the floor of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{floor}: Computes the floor of the given value.
 #'
-#' @rdname floor
-#' @name floor
-#' @aliases floor,Column-method
-#' @family math functions
+#' @rdname column_math_functions
+#' @aliases floor floor,Column-method
 #' @export
-#' @examples \dontrun{floor(df$c)}
 #' @note floor since 1.5.0
 setMethod("floor",
           signature(x = "Column"),
@@ -792,18 +753,12 @@ setMethod("floor",
             column(jc)
           })
 
-#' hex
-#'
-#' Computes hex value of the given column.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{hex}: Computes hex value of the given column.
 #'
-#' @rdname hex
-#' @name hex
-#' @family math functions
-#' @aliases hex,Column-method
+#' @rdname column_math_functions
+#' @aliases hex hex,Column-method
 #' @export
-#' @examples \dontrun{hex(df$c)}
 #' @note hex since 1.5.0
 setMethod("hex",
           signature(x = "Column"),
@@ -983,18 +938,12 @@ setMethod("length",
             column(jc)
           })
 
-#' log
-#'
-#' Computes the natural logarithm of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{log}: Computes the natural logarithm of the given value.
 #'
-#' @rdname log
-#' @name log
-#' @aliases log,Column-method
-#' @family math functions
+#' @rdname column_math_functions
+#' @aliases log log,Column-method
 #' @export
-#' @examples \dontrun{log(df$c)}
 #' @note log since 1.5.0
 setMethod("log",
           signature(x = "Column"),
@@ -1003,18 +952,12 @@ setMethod("log",
             column(jc)
           })
 
-#' log10
-#'
-#' Computes the logarithm of the given value in base 10.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{log10}: Computes the logarithm of the given value in base 10.
 #'
-#' @rdname log10
-#' @name log10
-#' @family math functions
-#' @aliases log10,Column-method
+#' @rdname column_math_functions
+#' @aliases log10 log10,Column-method
 #' @export
-#' @examples \dontrun{log10(df$c)}
 #' @note log10 since 1.5.0
 setMethod("log10",
           signature(x = "Column"),
@@ -1023,18 +966,12 @@ setMethod("log10",
             column(jc)
           })
 
-#' log1p
-#'
-#' Computes the natural logarithm of the given value plus one.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{log1p}: Computes the natural logarithm of the given value plus one.
 #'
-#' @rdname log1p
-#' @name log1p
-#' @family math functions
-#' @aliases log1p,Column-method
+#' @rdname column_math_functions
+#' @aliases log1p log1p,Column-method
 #' @export
-#' @examples \dontrun{log1p(df$c)}
 #' @note log1p since 1.5.0
 setMethod("log1p",
           signature(x = "Column"),
@@ -1043,18 +980,12 @@ setMethod("log1p",
             column(jc)
           })
 
-#' log2
-#'
-#' Computes the logarithm of the given column in base 2.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{log2}: Computes the logarithm of the given column in base 2.
 #'
-#' @rdname log2
-#' @name log2
-#' @family math functions
-#' @aliases log2,Column-method
+#' @rdname column_math_functions
+#' @aliases log2 log2,Column-method
 #' @export
-#' @examples \dontrun{log2(df$c)}
 #' @note log2 since 1.5.0
 setMethod("log2",
           signature(x = "Column"),
@@ -1287,19 +1218,13 @@ setMethod("reverse",
             column(jc)
           })
 
-#' rint
-#'
-#' Returns the double value that is closest in value to the argument and
+#' @details
+#' \code{rint}: Returns the double value that is closest in value to the 
argument and
 #' is equal to a mathematical integer.
 #'
-#' @param x Column to compute on.
-#'
-#' @rdname rint
-#' @name rint
-#' @family math functions
-#' @aliases rint,Column-method
+#' @rdname column_math_functions
+#' @aliases rint rint,Column-method
 #' @export
-#' @examples \dontrun{rint(df$c)}
 #' @note rint since 1.5.0
 setMethod("rint",
           signature(x = "Column"),
@@ -1308,18 +1233,13 @@ setMethod("rint",
             column(jc)
           })
 
-#' round
-#'
-#' Returns the value of the column \code{e} rounded to 0 decimal places using 
HALF_UP rounding mode.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{round}: Returns the value of the column rounded to 0 decimal places
+#' using HALF_UP rounding mode.
 #'
-#' @rdname round
-#' @name round
-#' @family math functions
-#' @aliases round,Column-method
+#' @rdname column_math_functions
+#' @aliases round round,Column-method
 #' @export
-#' @examples \dontrun{round(df$c)}
 #' @note round since 1.5.0
 setMethod("round",
           signature(x = "Column"),
@@ -1328,24 +1248,18 @@ setMethod("round",
             column(jc)
           })
 
-#' bround
-#'
-#' Returns the value of the column \code{e} rounded to \code{scale} decimal 
places using HALF_EVEN rounding
-#' mode if \code{scale} >= 0 or at integer part when \code{scale} < 0.
+#' @details
+#' \code{bround}: Returns the value of the column \code{e} rounded to 
\code{scale} decimal places
+#' using HALF_EVEN rounding mode if \code{scale} >= 0 or at integer part when 
\code{scale} < 0.
 #' Also known as Gaussian rounding or bankers' rounding that rounds to the 
nearest even number.
 #' bround(2.5, 0) = 2, bround(3.5, 0) = 4.
 #'
-#' @param x Column to compute on.
 #' @param scale round to \code{scale} digits to the right of the decimal point 
when \code{scale} > 0,
 #'        the nearest even number when \code{scale} = 0, and \code{scale} 
digits to the left
 #'        of the decimal point when \code{scale} < 0.
-#' @param ... further arguments to be passed to or from other methods.
-#' @rdname bround
-#' @name bround
-#' @family math functions
-#' @aliases bround,Column-method
+#' @rdname column_math_functions
+#' @aliases bround bround,Column-method
 #' @export
-#' @examples \dontrun{bround(df$c, 0)}
 #' @note bround since 2.0.0
 setMethod("bround",
           signature(x = "Column"),
@@ -1354,7 +1268,6 @@ setMethod("bround",
             column(jc)
           })
 
-
 #' rtrim
 #'
 #' Trim the spaces from right end for the specified string value.
@@ -1375,7 +1288,6 @@ setMethod("rtrim",
             column(jc)
           })
 
-
 #' @details
 #' \code{sd}: Alias for \code{stddev_samp}.
 #'
@@ -1429,18 +1341,12 @@ setMethod("sha1",
             column(jc)
           })
 
-#' signum
-#'
-#' Computes the signum of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{signum}: Computes the signum of the given value.
 #'
-#' @rdname sign
-#' @name signum
-#' @aliases signum,Column-method
-#' @family math functions
+#' @rdname column_math_functions
+#' @aliases signum signum,Column-method
 #' @export
-#' @examples \dontrun{signum(df$c)}
 #' @note signum since 1.5.0
 setMethod("signum",
           signature(x = "Column"),
@@ -1449,18 +1355,24 @@ setMethod("signum",
             column(jc)
           })
 
-#' sin
-#'
-#' Computes the sine of the given value.
+#' @details
+#' \code{sign}: Alias for \code{signum}.
 #'
-#' @param x Column to compute on.
+#' @rdname column_math_functions
+#' @aliases sign sign,Column-method
+#' @export
+#' @note sign since 1.5.0
+setMethod("sign", signature(x = "Column"),
+          function(x) {
+            signum(x)
+          })
+
+#' @details
+#' \code{sin}: Computes the sine of the given value.
 #'
-#' @rdname sin
-#' @name sin
-#' @family math functions
-#' @aliases sin,Column-method
+#' @rdname column_math_functions
+#' @aliases sin sin,Column-method
 #' @export
-#' @examples \dontrun{sin(df$c)}
 #' @note sin since 1.5.0
 setMethod("sin",
           signature(x = "Column"),
@@ -1469,18 +1381,12 @@ setMethod("sin",
             column(jc)
           })
 
-#' sinh
-#'
-#' Computes the hyperbolic sine of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{sinh}: Computes the hyperbolic sine of the given value.
 #'
-#' @rdname sinh
-#' @name sinh
-#' @family math functions
-#' @aliases sinh,Column-method
+#' @rdname column_math_functions
+#' @aliases sinh sinh,Column-method
 #' @export
-#' @examples \dontrun{sinh(df$c)}
 #' @note sinh since 1.5.0
 setMethod("sinh",
           signature(x = "Column"),
@@ -1616,18 +1522,12 @@ setMethod("struct",
             column(jc)
           })
 
-#' sqrt
-#'
-#' Computes the square root of the specified float value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{sqrt}: Computes the square root of the specified float value.
 #'
-#' @rdname sqrt
-#' @name sqrt
-#' @family math functions
-#' @aliases sqrt,Column-method
+#' @rdname column_math_functions
+#' @aliases sqrt sqrt,Column-method
 #' @export
-#' @examples \dontrun{sqrt(df$c)}
 #' @note sqrt since 1.5.0
 setMethod("sqrt",
           signature(x = "Column"),
@@ -1669,18 +1569,12 @@ setMethod("sumDistinct",
             column(jc)
           })
 
-#' tan
-#'
-#' Computes the tangent of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{tan}: Computes the tangent of the given value.
 #'
-#' @rdname tan
-#' @name tan
-#' @family math functions
-#' @aliases tan,Column-method
+#' @rdname column_math_functions
+#' @aliases tan tan,Column-method
 #' @export
-#' @examples \dontrun{tan(df$c)}
 #' @note tan since 1.5.0
 setMethod("tan",
           signature(x = "Column"),
@@ -1689,18 +1583,12 @@ setMethod("tan",
             column(jc)
           })
 
-#' tanh
-#'
-#' Computes the hyperbolic tangent of the given value.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{tanh}: Computes the hyperbolic tangent of the given value.
 #'
-#' @rdname tanh
-#' @name tanh
-#' @family math functions
-#' @aliases tanh,Column-method
+#' @rdname column_math_functions
+#' @aliases tanh tanh,Column-method
 #' @export
-#' @examples \dontrun{tanh(df$c)}
 #' @note tanh since 1.5.0
 setMethod("tanh",
           signature(x = "Column"),
@@ -1709,18 +1597,13 @@ setMethod("tanh",
             column(jc)
           })
 
-#' toDegrees
-#'
-#' Converts an angle measured in radians to an approximately equivalent angle 
measured in degrees.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{toDegrees}: Converts an angle measured in radians to an approximately 
equivalent angle
+#' measured in degrees.
 #'
-#' @rdname toDegrees
-#' @name toDegrees
-#' @family math functions
-#' @aliases toDegrees,Column-method
+#' @rdname column_math_functions
+#' @aliases toDegrees toDegrees,Column-method
 #' @export
-#' @examples \dontrun{toDegrees(df$c)}
 #' @note toDegrees since 1.4.0
 setMethod("toDegrees",
           signature(x = "Column"),
@@ -1729,18 +1612,13 @@ setMethod("toDegrees",
             column(jc)
           })
 
-#' toRadians
-#'
-#' Converts an angle measured in degrees to an approximately equivalent angle 
measured in radians.
-#'
-#' @param x Column to compute on.
+#' @details
+#' \code{toRadians}: Converts an angle measured in degrees to an approximately 
equivalent angle
+#' measured in radians.
 #'
-#' @rdname toRadians
-#' @name toRadians
-#' @family math functions
-#' @aliases toRadians,Column-method
+#' @rdname column_math_functions
+#' @aliases toRadians toRadians,Column-method
 #' @export
-#' @examples \dontrun{toRadians(df$c)}
 #' @note toRadians since 1.4.0
 setMethod("toRadians",
           signature(x = "Column"),
@@ -1894,19 +1772,13 @@ setMethod("unbase64",
             column(jc)
           })
 
-#' unhex
-#'
-#' Inverse of hex. Interprets each pair of characters as a hexadecimal number
+#' @details
+#' \code{unhex}: Inverse of hex. Interprets each pair of characters as a 
hexadecimal number
 #' and converts to the byte representation of number.
 #'
-#' @param x Column to compute on.
-#'
-#' @rdname unhex
-#' @name unhex
-#' @family math functions
-#' @aliases unhex,Column-method
+#' @rdname column_math_functions
+#' @aliases unhex unhex,Column-method
 #' @export
-#' @examples \dontrun{unhex(df$c)}
 #' @note unhex since 1.5.0
 setMethod("unhex",
           signature(x = "Column"),
@@ -2020,20 +1892,13 @@ setMethod("year",
             column(jc)
           })
 
-#' atan2
-#'
-#' Returns the angle theta from the conversion of rectangular coordinates (x, 
y) to
-#' polar coordinates (r, theta).
-#
-#' @param x Column to compute on.
-#' @param y Column to compute on.
+#' @details
+#' \code{atan2}: Returns the angle theta from the conversion of rectangular 
coordinates
+#' (x, y) to polar coordinates (r, theta).
 #'
-#' @rdname atan2
-#' @name atan2
-#' @family math functions
-#' @aliases atan2,Column-method
+#' @rdname column_math_functions
+#' @aliases atan2 atan2,Column-method
 #' @export
-#' @examples \dontrun{atan2(df$c, x)}
 #' @note atan2 since 1.5.0
 setMethod("atan2", signature(y = "Column"),
           function(y, x) {
@@ -2068,19 +1933,12 @@ setMethod("datediff", signature(y = "Column"),
             column(jc)
           })
 
-#' hypot
-#'
-#' Computes "sqrt(a^2 + b^2)" without intermediate overflow or underflow.
-#
-#' @param x Column to compute on.
-#' @param y Column to compute on.
+#' @details
+#' \code{hypot}: Computes "sqrt(a^2 + b^2)" without intermediate overflow or 
underflow.
 #'
-#' @rdname hypot
-#' @name hypot
-#' @family math functions
-#' @aliases hypot,Column-method
+#' @rdname column_math_functions
+#' @aliases hypot hypot,Column-method
 #' @export
-#' @examples \dontrun{hypot(df$c, x)}
 #' @note hypot since 1.4.0
 setMethod("hypot", signature(y = "Column"),
           function(y, x) {
@@ -2154,20 +2012,13 @@ setMethod("nanvl", signature(y = "Column"),
             column(jc)
           })
 
-#' pmod
-#'
-#' Returns the positive value of dividend mod divisor.
-#'
-#' @param x divisor Column.
-#' @param y dividend Column.
+#' @details
+#' \code{pmod}: Returns the positive value of dividend mod divisor.
+#' Column \code{x} is divisor column, and column \code{y} is the dividend 
column.
 #'
-#' @rdname pmod
-#' @name pmod
-#' @docType methods
-#' @family math functions
-#' @aliases pmod,Column-method
+#' @rdname column_math_functions
+#' @aliases pmod pmod,Column-method
 #' @export
-#' @examples \dontrun{pmod(df$c, x)}
 #' @note pmod since 1.5.0
 setMethod("pmod", signature(y = "Column"),
           function(y, x) {
@@ -2290,31 +2141,6 @@ setMethod("least",
             column(jc)
           })
 
-#' @rdname ceil
-#'
-#' @name ceiling
-#' @aliases ceiling,Column-method
-#' @export
-#' @examples \dontrun{ceiling(df$c)}
-#' @note ceiling since 1.5.0
-setMethod("ceiling",
-          signature(x = "Column"),
-          function(x) {
-            ceil(x)
-          })
-
-#' @rdname sign
-#'
-#' @name sign
-#' @aliases sign,Column-method
-#' @export
-#' @examples \dontrun{sign(df$c)}
-#' @note sign since 1.5.0
-setMethod("sign", signature(x = "Column"),
-          function(x) {
-            signum(x)
-          })
-
 #' @details
 #' \code{n_distinct}: Returns the number of distinct items in a group.
 #'
@@ -2564,20 +2390,13 @@ setMethod("sha2", signature(y = "Column", x = 
"numeric"),
             column(jc)
           })
 
-#' shiftLeft
-#'
-#' Shift the given value numBits left. If the given value is a long value, 
this function
-#' will return a long value else it will return an integer value.
-#'
-#' @param y column to compute on.
-#' @param x number of bits to shift.
+#' @details
+#' \code{shiftLeft}: Shifts the given value numBits left. If the given value 
is a long value,
+#' this function will return a long value else it will return an integer value.
 #'
-#' @family math functions
-#' @rdname shiftLeft
-#' @name shiftLeft
-#' @aliases shiftLeft,Column,numeric-method
+#' @rdname column_math_functions
+#' @aliases shiftLeft shiftLeft,Column,numeric-method
 #' @export
-#' @examples \dontrun{shiftLeft(df$c, 1)}
 #' @note shiftLeft since 1.5.0
 setMethod("shiftLeft", signature(y = "Column", x = "numeric"),
           function(y, x) {
@@ -2587,20 +2406,13 @@ setMethod("shiftLeft", signature(y = "Column", x = 
"numeric"),
             column(jc)
           })
 
-#' shiftRight
-#'
-#' (Signed) shift the given value numBits right. If the given value is a long 
value, it will return
-#' a long value else it will return an integer value.
-#'
-#' @param y column to compute on.
-#' @param x number of bits to shift.
+#' @details
+#' \code{shiftRight}: (Signed) shifts the given value numBits right. If the 
given value is a long value,
+#' it will return a long value else it will return an integer value.
 #'
-#' @family math functions
-#' @rdname shiftRight
-#' @name shiftRight
-#' @aliases shiftRight,Column,numeric-method
+#' @rdname column_math_functions
+#' @aliases shiftRight shiftRight,Column,numeric-method
 #' @export
-#' @examples \dontrun{shiftRight(df$c, 1)}
 #' @note shiftRight since 1.5.0
 setMethod("shiftRight", signature(y = "Column", x = "numeric"),
           function(y, x) {
@@ -2610,20 +2422,13 @@ setMethod("shiftRight", signature(y = "Column", x = 
"numeric"),
             column(jc)
           })
 
-#' shiftRightUnsigned
-#'
-#' Unsigned shift the given value numBits right. If the given value is a long 
value,
+#' @details
+#' \code{shiftRight}: (Unigned) shifts the given value numBits right. If the 
given value is a long value,
 #' it will return a long value else it will return an integer value.
 #'
-#' @param y column to compute on.
-#' @param x number of bits to shift.
-#'
-#' @family math functions
-#' @rdname shiftRightUnsigned
-#' @name shiftRightUnsigned
-#' @aliases shiftRightUnsigned,Column,numeric-method
+#' @rdname column_math_functions
+#' @aliases shiftRightUnsigned shiftRightUnsigned,Column,numeric-method
 #' @export
-#' @examples \dontrun{shiftRightUnsigned(df$c, 1)}
 #' @note shiftRightUnsigned since 1.5.0
 setMethod("shiftRightUnsigned", signature(y = "Column", x = "numeric"),
           function(y, x) {
@@ -2656,20 +2461,14 @@ setMethod("concat_ws", signature(sep = "character", x = 
"Column"),
             column(jc)
           })
 
-#' conv
-#'
-#' Convert a number in a string column from one base to another.
+#' @details
+#' \code{conv}: Converts a number in a string column from one base to another.
 #'
-#' @param x column to convert.
 #' @param fromBase base to convert from.
 #' @param toBase base to convert to.
-#'
-#' @family math functions
-#' @rdname conv
-#' @aliases conv,Column,numeric,numeric-method
-#' @name conv
+#' @rdname column_math_functions
+#' @aliases conv conv,Column,numeric,numeric-method
 #' @export
-#' @examples \dontrun{conv(df$n, 2, 16)}
 #' @note conv since 1.5.0
 setMethod("conv", signature(x = "Column", fromBase = "numeric", toBase = 
"numeric"),
           function(x, fromBase, toBase) {

http://git-wip-us.apache.org/repos/asf/spark/blob/e793bf24/R/pkg/R/generics.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/generics.R b/R/pkg/R/generics.R
index f105174..0248ec5 100644
--- a/R/pkg/R/generics.R
+++ b/R/pkg/R/generics.R
@@ -931,24 +931,28 @@ setGeneric("avg", function(x, ...) { 
standardGeneric("avg") })
 #' @export
 setGeneric("base64", function(x) { standardGeneric("base64") })
 
-#' @rdname bin
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("bin", function(x) { standardGeneric("bin") })
 
 #' @rdname bitwiseNOT
 #' @export
 setGeneric("bitwiseNOT", function(x) { standardGeneric("bitwiseNOT") })
 
-#' @rdname bround
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("bround", function(x, ...) { standardGeneric("bround") })
 
-#' @rdname cbrt
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("cbrt", function(x) { standardGeneric("cbrt") })
 
-#' @rdname ceil
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("ceil", function(x) { standardGeneric("ceil") })
 
 #' @rdname column_aggregate_functions
@@ -973,8 +977,9 @@ setGeneric("concat", function(x, ...) { 
standardGeneric("concat") })
 #' @export
 setGeneric("concat_ws", function(sep, x, ...) { standardGeneric("concat_ws") })
 
-#' @rdname conv
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("conv", function(x, fromBase, toBase) { standardGeneric("conv") })
 
 #' @rdname column_aggregate_functions
@@ -1094,8 +1099,9 @@ setGeneric("grouping_bit", function(x) { 
standardGeneric("grouping_bit") })
 #' @name NULL
 setGeneric("grouping_id", function(x, ...) { standardGeneric("grouping_id") })
 
-#' @rdname hex
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("hex", function(x) { standardGeneric("hex") })
 
 #' @rdname column_datetime_functions
@@ -1103,8 +1109,9 @@ setGeneric("hex", function(x) { standardGeneric("hex") })
 #' @name NULL
 setGeneric("hour", function(x) { standardGeneric("hour") })
 
-#' @rdname hypot
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("hypot", function(y, x) { standardGeneric("hypot") })
 
 #' @rdname initcap
@@ -1235,8 +1242,9 @@ setGeneric("n_distinct", function(x, ...) { 
standardGeneric("n_distinct") })
 #' @export
 setGeneric("percent_rank", function(x = "missing") { 
standardGeneric("percent_rank") })
 
-#' @rdname pmod
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("pmod", function(y, x) { standardGeneric("pmod") })
 
 #' @rdname posexplode
@@ -1281,8 +1289,9 @@ setGeneric("repeat_string", function(x, n) { 
standardGeneric("repeat_string") })
 #' @export
 setGeneric("reverse", function(x) { standardGeneric("reverse") })
 
-#' @rdname rint
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("rint", function(x) { standardGeneric("rint") })
 
 #' @param x empty. Should be used with no argument.
@@ -1316,20 +1325,24 @@ setGeneric("sha1", function(x) { 
standardGeneric("sha1") })
 #' @export
 setGeneric("sha2", function(y, x) { standardGeneric("sha2") })
 
-#' @rdname shiftLeft
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("shiftLeft", function(y, x) { standardGeneric("shiftLeft") })
 
-#' @rdname shiftRight
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("shiftRight", function(y, x) { standardGeneric("shiftRight") })
 
-#' @rdname shiftRightUnsigned
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("shiftRightUnsigned", function(y, x) { 
standardGeneric("shiftRightUnsigned") })
 
-#' @rdname sign
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("signum", function(x) { standardGeneric("signum") })
 
 #' @rdname size
@@ -1386,12 +1399,14 @@ setGeneric("substring_index", function(x, delim, count) 
{ standardGeneric("subst
 #' @name NULL
 setGeneric("sumDistinct", function(x) { standardGeneric("sumDistinct") })
 
-#' @rdname toDegrees
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("toDegrees", function(x) { standardGeneric("toDegrees") })
 
-#' @rdname toRadians
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("toRadians", function(x) { standardGeneric("toRadians") })
 
 #' @rdname column_datetime_functions
@@ -1425,8 +1440,9 @@ setGeneric("trim", function(x) { standardGeneric("trim") 
})
 #' @export
 setGeneric("unbase64", function(x) { standardGeneric("unbase64") })
 
-#' @rdname unhex
+#' @rdname column_math_functions
 #' @export
+#' @name NULL
 setGeneric("unhex", function(x) { standardGeneric("unhex") })
 
 #' @rdname column_datetime_functions


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to