Skip to content

Commit 0297896

Browse files
junyangqshivaram
authored andcommitted
[SPARK-16508][SPARKR] Fix CRAN undocumented/duplicated arguments warnings.
This PR tries to fix all the remaining "undocumented/duplicated arguments" warnings given by CRAN-check. One left is doc for R `stats::glm` exported in SparkR. To mute that warning, we have to also provide document for all arguments of that non-SparkR function. Some previous conversation is in #14558. R unit test and `check-cran.sh` script (with no-test). Author: Junyang Qian <[email protected]> Closes #14705 from junyangq/SPARK-16508-master. (cherry picked from commit 01401e9) Signed-off-by: Shivaram Venkataraman <[email protected]>
1 parent 26d5a8b commit 0297896

File tree

11 files changed

+415
-263
lines changed

11 files changed

+415
-263
lines changed

R/pkg/R/DataFrame.R

Lines changed: 126 additions & 93 deletions
Large diffs are not rendered by default.

R/pkg/R/SQLContext.R

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ getDefaultSqlSource <- function() {
165165
#'
166166
#' Converts R data.frame or list into SparkDataFrame.
167167
#'
168-
#' @param data An RDD or list or data.frame
169-
#' @param schema a list of column names or named list (StructType), optional
170-
#' @return a SparkDataFrame
168+
#' @param data an RDD or list or data.frame.
169+
#' @param schema a list of column names or named list (StructType), optional.
170+
#' @return A SparkDataFrame.
171171
#' @rdname createDataFrame
172172
#' @export
173173
#' @examples
@@ -257,23 +257,25 @@ createDataFrame.default <- function(data, schema = NULL, samplingRatio = 1.0) {
257257
}
258258

259259
createDataFrame <- function(x, ...) {
260-
dispatchFunc("createDataFrame(data, schema = NULL, samplingRatio = 1.0)", x, ...)
260+
dispatchFunc("createDataFrame(data, schema = NULL)", x, ...)
261261
}
262262

263+
#' @param samplingRatio Currently not used.
263264
#' @rdname createDataFrame
264265
#' @aliases createDataFrame
265266
#' @export
266267
#' @method as.DataFrame default
267268
#' @note as.DataFrame since 1.6.0
268269
as.DataFrame.default <- function(data, schema = NULL, samplingRatio = 1.0) {
269-
createDataFrame(data, schema, samplingRatio)
270+
createDataFrame(data, schema)
270271
}
271272

273+
#' @param ... additional argument(s).
272274
#' @rdname createDataFrame
273275
#' @aliases as.DataFrame
274276
#' @export
275-
as.DataFrame <- function(x, ...) {
276-
dispatchFunc("as.DataFrame(data, schema = NULL, samplingRatio = 1.0)", x, ...)
277+
as.DataFrame <- function(data, ...) {
278+
dispatchFunc("as.DataFrame(data, schema = NULL)", data, ...)
277279
}
278280

279281
#' toDF
@@ -398,7 +400,7 @@ read.orc <- function(path) {
398400
#'
399401
#' Loads a Parquet file, returning the result as a SparkDataFrame.
400402
#'
401-
#' @param path Path of file to read. A vector of multiple paths is allowed.
403+
#' @param path path of file to read. A vector of multiple paths is allowed.
402404
#' @return SparkDataFrame
403405
#' @rdname read.parquet
404406
#' @export
@@ -418,6 +420,7 @@ read.parquet <- function(x, ...) {
418420
dispatchFunc("read.parquet(...)", x, ...)
419421
}
420422

423+
#' @param ... argument(s) passed to the method.
421424
#' @rdname read.parquet
422425
#' @name parquetFile
423426
#' @export
@@ -727,6 +730,7 @@ dropTempView <- function(viewName) {
727730
#' @param source The name of external data source
728731
#' @param schema The data schema defined in structType
729732
#' @param na.strings Default string value for NA when source is "csv"
733+
#' @param ... additional external data source specific named properties.
730734
#' @return SparkDataFrame
731735
#' @rdname read.df
732736
#' @name read.df
@@ -791,10 +795,11 @@ loadDF <- function(x, ...) {
791795
#' If `source` is not specified, the default data source configured by
792796
#' "spark.sql.sources.default" will be used.
793797
#'
794-
#' @param tableName A name of the table
795-
#' @param path The path of files to load
796-
#' @param source the name of external data source
797-
#' @return SparkDataFrame
798+
#' @param tableName a name of the table.
799+
#' @param path the path of files to load.
800+
#' @param source the name of external data source.
801+
#' @param ... additional argument(s) passed to the method.
802+
#' @return A SparkDataFrame.
798803
#' @rdname createExternalTable
799804
#' @export
800805
#' @examples
@@ -840,6 +845,7 @@ createExternalTable <- function(x, ...) {
840845
#' clause expressions used to split the column `partitionColumn` evenly.
841846
#' This defaults to SparkContext.defaultParallelism when unset.
842847
#' @param predicates a list of conditions in the where clause; each one defines one partition
848+
#' @param ... additional JDBC database connection named propertie(s).
843849
#' @return SparkDataFrame
844850
#' @rdname read.jdbc
845851
#' @name read.jdbc

R/pkg/R/WindowSpec.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ setMethod("show", "WindowSpec",
5454
#'
5555
#' Defines the partitioning columns in a WindowSpec.
5656
#'
57-
#' @param x a WindowSpec
58-
#' @return a WindowSpec
57+
#' @param x a WindowSpec.
58+
#' @param col a column to partition on (desribed by the name or Column).
59+
#' @param ... additional column(s) to partition on.
60+
#' @return A WindowSpec.
5961
#' @rdname partitionBy
6062
#' @name partitionBy
6163
#' @aliases partitionBy,WindowSpec-method
@@ -86,7 +88,7 @@ setMethod("partitionBy",
8688
#'
8789
#' Defines the ordering columns in a WindowSpec.
8890
#' @param x a WindowSpec
89-
#' @param col a character or Column object indicating an ordering column
91+
#' @param col a character or Column indicating an ordering column
9092
#' @param ... additional sorting fields
9193
#' @return A WindowSpec.
9294
#' @name orderBy
@@ -192,6 +194,9 @@ setMethod("rangeBetween",
192194
#'
193195
#' Define a windowing column.
194196
#'
197+
#' @param x a Column, usually one returned by window function(s).
198+
#' @param window a WindowSpec object. Can be created by `windowPartitionBy` or
199+
#' `windowOrderBy` and configured by other WindowSpec methods.
195200
#' @rdname over
196201
#' @name over
197202
#' @aliases over,Column,WindowSpec-method

R/pkg/R/column.R

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ setMethod("alias",
163163
#' @family colum_func
164164
#' @aliases substr,Column-method
165165
#'
166-
#' @param start starting position
167-
#' @param stop ending position
166+
#' @param x a Column.
167+
#' @param start starting position.
168+
#' @param stop ending position.
168169
#' @note substr since 1.4.0
169170
setMethod("substr", signature(x = "Column"),
170171
function(x, start, stop) {
@@ -219,6 +220,7 @@ setMethod("endsWith", signature(x = "Column"),
219220
#' @family colum_func
220221
#' @aliases between,Column-method
221222
#'
223+
#' @param x a Column
222224
#' @param bounds lower and upper bounds
223225
#' @note between since 1.5.0
224226
setMethod("between", signature(x = "Column"),
@@ -233,6 +235,11 @@ setMethod("between", signature(x = "Column"),
233235

234236
#' Casts the column to a different data type.
235237
#'
238+
#' @param x a Column.
239+
#' @param dataType a character object describing the target data type.
240+
#' See
241+
#' \href{https://spark.apache.org/docs/latest/sparkr.html#data-type-mapping-between-r-and-spark}{
242+
#' Spark Data Types} for available data types.
236243
#' @rdname cast
237244
#' @name cast
238245
#' @family colum_func
@@ -254,10 +261,12 @@ setMethod("cast",
254261

255262
#' Match a column with given values.
256263
#'
264+
#' @param x a Column.
265+
#' @param table a collection of values (coercible to list) to compare with.
257266
#' @rdname match
258267
#' @name %in%
259268
#' @aliases %in%,Column-method
260-
#' @return a matched values as a result of comparing with given values.
269+
#' @return A matched values as a result of comparing with given values.
261270
#' @export
262271
#' @examples
263272
#' \dontrun{
@@ -277,6 +286,9 @@ setMethod("%in%",
277286
#' If values in the specified column are null, returns the value.
278287
#' Can be used in conjunction with `when` to specify a default value for expressions.
279288
#'
289+
#' @param x a Column.
290+
#' @param value value to replace when the corresponding entry in \code{x} is NA.
291+
#' Can be a single value or a Column.
280292
#' @rdname otherwise
281293
#' @name otherwise
282294
#' @family colum_func

0 commit comments

Comments
 (0)