Repository: spark
Updated Branches:
  refs/heads/master 2d6919bea -> 57746295e


[SPARK-16109][SPARKR][DOC] R more doc fixes

## What changes were proposed in this pull request?

Found these issues while reviewing for SPARK-16090

## How was this patch tested?

roxygen2 doc gen, checked output html

Author: Felix Cheung <felixcheun...@hotmail.com>

Closes #13803 from felixcheung/rdocrd.


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

Branch: refs/heads/master
Commit: 57746295e6fb705f8393a00ab1cc570ddb7da44e
Parents: 2d6919b
Author: Felix Cheung <felixcheun...@hotmail.com>
Authored: Tue Jun 21 11:01:42 2016 -0700
Committer: Shivaram Venkataraman <shiva...@cs.berkeley.edu>
Committed: Tue Jun 21 11:01:42 2016 -0700

----------------------------------------------------------------------
 R/pkg/R/DataFrame.R |  7 +++++--
 R/pkg/R/functions.R |  4 +++-
 R/pkg/R/generics.R  |  8 ++++----
 R/pkg/R/schema.R    |  7 +++++--
 R/pkg/R/stats.R     | 37 +++++++++++++++++++++++--------------
 5 files changed, 40 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/57746295/R/pkg/R/DataFrame.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R
index a8ade1a..ed0bb85 100644
--- a/R/pkg/R/DataFrame.R
+++ b/R/pkg/R/DataFrame.R
@@ -59,6 +59,7 @@ setMethod("initialize", "SparkDataFrame", function(.Object, 
sdf, isCached) {
 #' @export
 #' @param sdf A Java object reference to the backing Scala DataFrame
 #' @param isCached TRUE if the SparkDataFrame is cached
+#' @noRd
 dataFrame <- function(sdf, isCached = FALSE) {
   new("SparkDataFrame", sdf, isCached)
 }
@@ -119,7 +120,7 @@ setMethod("schema",
 #' Print the logical and physical Catalyst plans to the console for debugging.
 #'
 #' @param x A SparkDataFrame
-#' @param extended Logical. If extended is False, explain() only prints the 
physical plan.
+#' @param extended Logical. If extended is FALSE, explain() only prints the 
physical plan.
 #' @family SparkDataFrame functions
 #' @rdname explain
 #' @name explain
@@ -175,6 +176,8 @@ setMethod("isLocal",
 #'
 #' @param x A SparkDataFrame
 #' @param numRows The number of rows to print. Defaults to 20.
+#' @param truncate Whether truncate long strings. If true, strings more than 
20 characters will be
+#' truncated and all cells will be aligned right
 #'
 #' @family SparkDataFrame functions
 #' @rdname showDF
@@ -1854,7 +1857,7 @@ setMethod("withColumnRenamed",
             select(x, cols)
           })
 
-#' @param newColPair A named pair of the form new_column_name = existing_column
+#' @param ... A named pair of the form new_column_name = existing_column
 #' @rdname rename
 #' @name rename
 #' @export

http://git-wip-us.apache.org/repos/asf/spark/blob/57746295/R/pkg/R/functions.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/functions.R b/R/pkg/R/functions.R
index 6e0009f..09e5afa 100644
--- a/R/pkg/R/functions.R
+++ b/R/pkg/R/functions.R
@@ -1777,7 +1777,7 @@ setMethod("months_between", signature(y = "Column"),
 #' nanvl
 #'
 #' Returns col1 if it is not NaN, or col2 if col1 is NaN.
-#' hhBoth inputs should be floating point columns (DoubleType or FloatType).
+#' Both inputs should be floating point columns (DoubleType or FloatType).
 #'
 #' @rdname nanvl
 #' @name nanvl
@@ -2008,6 +2008,8 @@ setMethod("from_utc_timestamp", signature(y = "Column", x 
= "character"),
 #' NOTE: The position is not zero based, but 1 based index, returns 0 if substr
 #' could not be found in str.
 #'
+#' @param y column to check
+#' @param x substring to check
 #' @family string_funcs
 #' @rdname instr
 #' @name instr

http://git-wip-us.apache.org/repos/asf/spark/blob/57746295/R/pkg/R/generics.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/generics.R b/R/pkg/R/generics.R
index 43395aa..7b08a8e 100644
--- a/R/pkg/R/generics.R
+++ b/R/pkg/R/generics.R
@@ -59,15 +59,15 @@ setGeneric("count", function(x) { standardGeneric("count") 
})
 # @export
 setGeneric("countByValue", function(x) { standardGeneric("countByValue") })
 
-# @rdname statfunctions
+# @rdname crosstab
 # @export
 setGeneric("crosstab", function(x, col1, col2) { standardGeneric("crosstab") })
 
-# @rdname statfunctions
+# @rdname freqItems
 # @export
 setGeneric("freqItems", function(x, cols, support = 0.01) { 
standardGeneric("freqItems") })
 
-# @rdname statfunctions
+# @rdname approxQuantile
 # @export
 setGeneric("approxQuantile",
            function(x, col, probabilities, relativeError) {
@@ -575,7 +575,7 @@ setGeneric("sample",
 setGeneric("sample_frac",
            function(x, withReplacement, fraction, seed) { 
standardGeneric("sample_frac") })
 
-#' @rdname statfunctions
+#' @rdname sampleBy
 #' @export
 setGeneric("sampleBy", function(x, col, fractions, seed) { 
standardGeneric("sampleBy") })
 

http://git-wip-us.apache.org/repos/asf/spark/blob/57746295/R/pkg/R/schema.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/schema.R b/R/pkg/R/schema.R
index fb23c78..a91e998 100644
--- a/R/pkg/R/schema.R
+++ b/R/pkg/R/schema.R
@@ -86,9 +86,8 @@ print.structType <- function(x, ...) {
 #' Create a structField object that contains the metadata for a single field 
in a schema.
 #'
 #' @param x The name of the field
-#' @param type The data type of the field
-#' @param nullable A logical vector indicating whether or not the field is 
nullable
 #' @return a structField object
+#' @rdname structField
 #' @export
 #' @examples
 #'\dontrun{
@@ -176,6 +175,10 @@ checkType <- function(type) {
   stop(paste("Unsupported type for SparkDataframe:", type))
 }
 
+#' @param type The data type of the field
+#' @param nullable A logical vector indicating whether or not the field is 
nullable
+#' @rdname structField
+#' @export
 structField.character <- function(x, type, nullable = TRUE) {
   if (class(x) != "character") {
     stop("Field name must be a string.")

http://git-wip-us.apache.org/repos/asf/spark/blob/57746295/R/pkg/R/stats.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/stats.R b/R/pkg/R/stats.R
index e40b177..c92352e 100644
--- a/R/pkg/R/stats.R
+++ b/R/pkg/R/stats.R
@@ -19,10 +19,9 @@
 
 setOldClass("jobj")
 
-#' @title SparkDataFrame statistic functions
-
-#' @description
-#' crosstab - Computes a pair-wise frequency table of the given columns. Also 
known as a contingency
+#' Computes a pair-wise frequency table of the given columns
+#'
+#' Computes a pair-wise frequency table of the given columns. Also known as a 
contingency
 #' table. The number of distinct values for each column should be less than 
1e4. At most 1e6
 #' non-zero pair frequencies will be returned.
 #'
@@ -33,8 +32,9 @@ setOldClass("jobj")
 #'         of `col2`. The name of the first column will be `$col1_$col2`. 
Pairs that have no
 #'         occurrences will have zero as their counts.
 #'
-#' @rdname statfunctions
+#' @rdname crosstab
 #' @name crosstab
+#' @family stat functions
 #' @export
 #' @examples
 #' \dontrun{
@@ -59,6 +59,7 @@ setMethod("crosstab",
 #'
 #' @rdname cov
 #' @name cov
+#' @family stat functions
 #' @export
 #' @examples
 #'\dontrun{
@@ -87,6 +88,7 @@ setMethod("cov",
 #'
 #' @rdname corr
 #' @name corr
+#' @family stat functions
 #' @export
 #' @examples
 #'\dontrun{
@@ -103,8 +105,10 @@ setMethod("corr",
             callJMethod(statFunctions, "corr", col1, col2, method)
           })
 
-#' @description
-#' freqItems - Finding frequent items for columns, possibly with false 
positives.
+
+#' Finding frequent items for columns, possibly with false positives
+#'
+#' Finding frequent items for columns, possibly with false positives.
 #' Using the frequent element count algorithm described in
 #' \url{http://dx.doi.org/10.1145/762471.762473}, proposed by Karp, Schenker, 
and Papadimitriou.
 #'
@@ -114,8 +118,9 @@ setMethod("corr",
 #'                Should be greater than 1e-4. Default support = 0.01.
 #' @return a local R data.frame with the frequent items in each column
 #'
-#' @rdname statfunctions
+#' @rdname freqItems
 #' @name freqItems
+#' @family stat functions
 #' @export
 #' @examples
 #' \dontrun{
@@ -130,8 +135,9 @@ setMethod("freqItems", signature(x = "SparkDataFrame", cols 
= "character"),
             collect(dataFrame(sct))
           })
 
-#' @description
-#' approxQuantile - Calculates the approximate quantiles of a numerical column 
of a SparkDataFrame.
+#' Calculates the approximate quantiles of a numerical column of a 
SparkDataFrame
+#'
+#' Calculates the approximate quantiles of a numerical column of a 
SparkDataFrame.
 #' The result of this algorithm has the following deterministic bound:
 #' If the SparkDataFrame has N elements and if we request the quantile at 
probability `p` up to
 #' error `err`, then the algorithm will return a sample `x` from the 
SparkDataFrame so that the
@@ -150,8 +156,9 @@ setMethod("freqItems", signature(x = "SparkDataFrame", cols 
= "character"),
 #'                      Note that values greater than 1 are accepted but give 
the same result as 1.
 #' @return The approximate quantiles at the given probabilities.
 #'
-#' @rdname statfunctions
+#' @rdname approxQuantile
 #' @name approxQuantile
+#' @family stat functions
 #' @export
 #' @examples
 #' \dontrun{
@@ -168,8 +175,9 @@ setMethod("approxQuantile",
                         as.list(probabilities), relativeError)
           })
 
-#' @description
-#' sampleBy - Returns a stratified sample without replacement based on the 
fraction given on each
+#' Returns a stratified sample without replacement
+#'
+#' Returns a stratified sample without replacement based on the fraction given 
on each
 #' stratum.
 #'
 #' @param x A SparkDataFrame
@@ -179,8 +187,9 @@ setMethod("approxQuantile",
 #' @param seed random seed
 #' @return A new SparkDataFrame that represents the stratified sample
 #'
-#' @rdname statfunctions
+#' @rdname sampleBy
 #' @name sampleBy
+#' @family stat functions
 #' @export
 #' @examples
 #'\dontrun{


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

Reply via email to