Skip to content

Commit 82e2f09

Browse files
committed
Fix part of undocumented/duplicated arguments warnings by CRAN-check
1 parent bbbd3cb commit 82e2f09

File tree

12 files changed

+273
-193
lines changed

12 files changed

+273
-193
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,8 @@ spark-warehouse/
7777
# For R session data
7878
.RData
7979
.RHistory
80+
.Rhistory
81+
*.Rproj
82+
*.Rproj.*
83+
84+
.Rproj.user

R/pkg/R/DataFrame.R

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ setMethod("schema",
120120
#'
121121
#' Print the logical and physical Catalyst plans to the console for debugging.
122122
#'
123-
#' @param x A SparkDataFrame
124123
#' @param extended Logical. If extended is FALSE, explain() only prints the physical plan.
125124
#' @family SparkDataFrame functions
126125
#' @aliases explain,SparkDataFrame-method
@@ -177,11 +176,10 @@ setMethod("isLocal",
177176
#'
178177
#' Print the first numRows rows of a SparkDataFrame
179178
#'
180-
#' @param x A SparkDataFrame
181-
#' @param numRows The number of rows to print. Defaults to 20.
182-
#' @param truncate Whether truncate long strings. If true, strings more than 20 characters will be
183-
#' truncated and all cells will be aligned right
184-
#'
179+
#' @param numRows the number of rows to print. Defaults to 20.
180+
#' @param truncate whether truncate long strings. If true, strings more than 20 characters will be
181+
#' truncated. However, if set greater than zero, truncates strings longer than `truncate`
182+
#' characters and all cells will be aligned right.
185183
#' @family SparkDataFrame functions
186184
#' @aliases showDF,SparkDataFrame-method
187185
#' @rdname showDF
@@ -206,7 +204,7 @@ setMethod("showDF",
206204
#'
207205
#' Print the SparkDataFrame column names and types
208206
#'
209-
#' @param x A SparkDataFrame
207+
#' @param object a SparkDataFrame.
210208
#'
211209
#' @family SparkDataFrame functions
212210
#' @rdname show
@@ -318,6 +316,7 @@ setMethod("colnames",
318316
columns(x)
319317
})
320318

319+
#' @param value a character vector. Must have the same length as the number of columns in the SparkDataFrame.
321320
#' @rdname columns
322321
#' @aliases colnames<-,SparkDataFrame-method
323322
#' @name colnames<-
@@ -406,7 +405,6 @@ setMethod("coltypes",
406405
#'
407406
#' Set the column types of a SparkDataFrame.
408407
#'
409-
#' @param x A SparkDataFrame
410408
#' @param value A character vector with the target column types for the given
411409
#' SparkDataFrame. Column types can be one of integer, numeric/double, character, logical, or NA
412410
#' to keep that column as-is.
@@ -510,9 +508,9 @@ setMethod("registerTempTable",
510508
#'
511509
#' Insert the contents of a SparkDataFrame into a table registered in the current SparkSession.
512510
#'
513-
#' @param x A SparkDataFrame
514-
#' @param tableName A character vector containing the name of the table
515-
#' @param overwrite A logical argument indicating whether or not to overwrite
511+
#' @param x a SparkDataFrame.
512+
#' @param tableName a character vector containing the name of the table.
513+
#' @param overwrite a logical argument indicating whether or not to overwrite.
516514
#' the existing rows in the table.
517515
#'
518516
#' @family SparkDataFrame functions
@@ -571,7 +569,9 @@ setMethod("cache",
571569
#' supported storage levels, refer to
572570
#' \url{http://spark.apache.org/docs/latest/programming-guide.html#rdd-persistence}.
573571
#'
574-
#' @param x The SparkDataFrame to persist
572+
#' @param x the SparkDataFrame to persist.
573+
#' @param newLevel storage level chosen for the persistance. See available options in
574+
#' the description.
575575
#'
576576
#' @family SparkDataFrame functions
577577
#' @rdname persist
@@ -634,9 +634,10 @@ setMethod("unpersist",
634634
#' \item{3.} {Return a new SparkDataFrame partitioned by the given column(s),
635635
#' using `spark.sql.shuffle.partitions` as number of partitions.}
636636
#'}
637-
#' @param x A SparkDataFrame
638-
#' @param numPartitions The number of partitions to use.
639-
#' @param col The column by which the partitioning will be performed.
637+
#' @param x a SparkDataFrame.
638+
#' @param numPartitions the number of partitions to use.
639+
#' @param col the column by which the partitioning will be performed.
640+
#' @param ... additional column(s) to be used in the partitioning.
640641
#'
641642
#' @family SparkDataFrame functions
642643
#' @rdname repartition
@@ -915,8 +916,6 @@ setMethod("sample_frac",
915916

916917
#' Returns the number of rows in a SparkDataFrame
917918
#'
918-
#' @param x A SparkDataFrame
919-
#'
920919
#' @family SparkDataFrame functions
921920
#' @rdname nrow
922921
#' @name count
@@ -1092,8 +1091,10 @@ setMethod("limit",
10921091
dataFrame(res)
10931092
})
10941093

1095-
#' Take the first NUM rows of a SparkDataFrame and return a the results as a R data.frame
1094+
#' Take the first NUM rows of a SparkDataFrame and return the results as a R data.frame
10961095
#'
1096+
#' @param x a SparkDataFrame.
1097+
#' @param num number of rows to take.
10971098
#' @family SparkDataFrame functions
10981099
#' @rdname take
10991100
#' @name take
@@ -1120,9 +1121,9 @@ setMethod("take",
11201121
#' then head() returns the first 6 rows in keeping with the current data.frame
11211122
#' convention in R.
11221123
#'
1123-
#' @param x A SparkDataFrame
1124-
#' @param num The number of rows to return. Default is 6.
1125-
#' @return A data.frame
1124+
#' @param x a SparkDataFrame.
1125+
#' @param num the number of rows to return. Default is 6.
1126+
#' @return A data.frame.
11261127
#'
11271128
#' @family SparkDataFrame functions
11281129
#' @aliases head,SparkDataFrame-method
@@ -1146,7 +1147,7 @@ setMethod("head",
11461147

11471148
#' Return the first row of a SparkDataFrame
11481149
#'
1149-
#' @param x A SparkDataFrame
1150+
#' @param x a SparkDataFrame or a column used in aggregation function.
11501151
#'
11511152
#' @family SparkDataFrame functions
11521153
#' @aliases first,SparkDataFrame-method
@@ -1240,7 +1241,6 @@ setMethod("group_by",
12401241
#'
12411242
#' Compute aggregates by specifying a list of columns
12421243
#'
1243-
#' @param x a SparkDataFrame
12441244
#' @family SparkDataFrame functions
12451245
#' @aliases agg,SparkDataFrame-method
12461246
#' @rdname summarize
@@ -1387,16 +1387,15 @@ setMethod("dapplyCollect",
13871387
#' Groups the SparkDataFrame using the specified columns and applies the R function to each
13881388
#' group.
13891389
#'
1390-
#' @param x A SparkDataFrame
1391-
#' @param cols Grouping columns
1392-
#' @param func A function to be applied to each group partition specified by grouping
1390+
#' @param cols grouping columns.
1391+
#' @param func a function to be applied to each group partition specified by grouping
13931392
#' column of the SparkDataFrame. The function `func` takes as argument
13941393
#' a key - grouping columns and a data frame - a local R data.frame.
13951394
#' The output of `func` is a local R data.frame.
1396-
#' @param schema The schema of the resulting SparkDataFrame after the function is applied.
1395+
#' @param schema the schema of the resulting SparkDataFrame after the function is applied.
13971396
#' The schema must match to output of `func`. It has to be defined for each
13981397
#' output column with preferred output column name and corresponding data type.
1399-
#' @return a SparkDataFrame
1398+
#' @return A SparkDataFrame.
14001399
#' @family SparkDataFrame functions
14011400
#' @aliases gapply,SparkDataFrame-method
14021401
#' @rdname gapply
@@ -1479,13 +1478,12 @@ setMethod("gapply",
14791478
#' Groups the SparkDataFrame using the specified columns, applies the R function to each
14801479
#' group and collects the result back to R as data.frame.
14811480
#'
1482-
#' @param x A SparkDataFrame
1483-
#' @param cols Grouping columns
1484-
#' @param func A function to be applied to each group partition specified by grouping
1481+
#' @param cols grouping columns.
1482+
#' @param func a function to be applied to each group partition specified by grouping
14851483
#' column of the SparkDataFrame. The function `func` takes as argument
14861484
#' a key - grouping columns and a data frame - a local R data.frame.
14871485
#' The output of `func` is a local R data.frame.
1488-
#' @return a data.frame
1486+
#' @return A data.frame.
14891487
#' @family SparkDataFrame functions
14901488
#' @aliases gapplyCollect,SparkDataFrame-method
14911489
#' @rdname gapplyCollect
@@ -2461,8 +2459,8 @@ setMethod("unionAll",
24612459
#' Union two or more SparkDataFrames. This is equivalent to `UNION ALL` in SQL.
24622460
#' Note that this does not remove duplicate rows across the two SparkDataFrames.
24632461
#'
2464-
#' @param x A SparkDataFrame
2465-
#' @param ... Additional SparkDataFrame
2462+
#' @param x a SparkDataFrame.
2463+
#' @param ... additional SparkDataFrame(s).
24662464
#' @return A SparkDataFrame containing the result of the union.
24672465
#' @family SparkDataFrame functions
24682466
#' @aliases rbind,SparkDataFrame-method
@@ -2519,8 +2517,8 @@ setMethod("intersect",
25192517
#' Return a new SparkDataFrame containing rows in this SparkDataFrame
25202518
#' but not in another SparkDataFrame. This is equivalent to `EXCEPT` in SQL.
25212519
#'
2522-
#' @param x A SparkDataFrame
2523-
#' @param y A SparkDataFrame
2520+
#' @param x a SparkDataFrame.
2521+
#' @param y a SparkDataFrame.
25242522
#' @return A SparkDataFrame containing the result of the except operation.
25252523
#' @family SparkDataFrame functions
25262524
#' @aliases except,SparkDataFrame,SparkDataFrame-method
@@ -2561,10 +2559,11 @@ setMethod("except",
25612559
#' and to not change the existing data.
25622560
#' }
25632561
#'
2564-
#' @param df A SparkDataFrame
2565-
#' @param path A name for the table
2566-
#' @param source A name for external data source
2567-
#' @param mode One of 'append', 'overwrite', 'error', 'ignore' save mode (it is 'error' by default)
2562+
#' @param df a SparkDataFrame.
2563+
#' @param path a name for the table.
2564+
#' @param source a name for external data source.
2565+
#' @param mode one of 'append', 'overwrite', 'error', 'ignore' save mode (it is 'error' by default)
2566+
#' @param ... additional argument(s) passed to the method.
25682567
#'
25692568
#' @family SparkDataFrame functions
25702569
#' @aliases write.df,SparkDataFrame,character-method
@@ -2623,10 +2622,11 @@ setMethod("saveDF",
26232622
#' ignore: The save operation is expected to not save the contents of the SparkDataFrame
26242623
#' and to not change the existing data. \cr
26252624
#'
2626-
#' @param df A SparkDataFrame
2627-
#' @param tableName A name for the table
2628-
#' @param source A name for external data source
2629-
#' @param mode One of 'append', 'overwrite', 'error', 'ignore' save mode (it is 'error' by default)
2625+
#' @param df a SparkDataFrame.
2626+
#' @param tableName a name for the table.
2627+
#' @param source a name for external data source.
2628+
#' @param mode one of 'append', 'overwrite', 'error', 'ignore' save mode (it is 'error' by default).
2629+
#' @param ... additional option(s) passed to the method.
26302630
#'
26312631
#' @family SparkDataFrame functions
26322632
#' @aliases saveAsTable,SparkDataFrame,character-method
@@ -2662,10 +2662,10 @@ setMethod("saveAsTable",
26622662
#' Computes statistics for numeric columns.
26632663
#' If no columns are given, this function computes statistics for all numerical columns.
26642664
#'
2665-
#' @param x A SparkDataFrame to be computed.
2666-
#' @param col A string of name
2667-
#' @param ... Additional expressions
2668-
#' @return A SparkDataFrame
2665+
#' @param x a SparkDataFrame to be computed.
2666+
#' @param col a string of name.
2667+
#' @param ... additional expressions.
2668+
#' @return A SparkDataFrame.
26692669
#' @family SparkDataFrame functions
26702670
#' @aliases describe,SparkDataFrame,character-method describe,SparkDataFrame,ANY-method
26712671
#' @rdname summary
@@ -2700,6 +2700,7 @@ setMethod("describe",
27002700
dataFrame(sdf)
27012701
})
27022702

2703+
#' @param object a SparkDataFrame to be summarized.
27032704
#' @rdname summary
27042705
#' @name summary
27052706
#' @aliases summary,SparkDataFrame-method
@@ -2715,16 +2716,20 @@ setMethod("summary",
27152716
#'
27162717
#' dropna, na.omit - Returns a new SparkDataFrame omitting rows with null values.
27172718
#'
2718-
#' @param x A SparkDataFrame.
2719+
#' @param x a SparkDataFrame.
27192720
#' @param how "any" or "all".
27202721
#' if "any", drop a row if it contains any nulls.
27212722
#' if "all", drop a row only if all its values are null.
27222723
#' if minNonNulls is specified, how is ignored.
2723-
#' @param minNonNulls If specified, drop rows that have less than
2724+
#' @param minNonNulls if specified, drop rows that have less than
27242725
#' minNonNulls non-null values.
27252726
#' This overwrites the how parameter.
2726-
#' @param cols Optional list of column names to consider.
2727-
#' @return A SparkDataFrame
2727+
#' @param cols optional list of column names to consider. In `fillna`,
2728+
#' columns specified in cols that do not have matching data
2729+
#' type are ignored. For example, if value is a character, and
2730+
#' subset contains a non-character column, then the non-character
2731+
#' column is simply ignored.
2732+
#' @return A SparkDataFrame.
27282733
#'
27292734
#' @family SparkDataFrame functions
27302735
#' @rdname nafunctions
@@ -2769,18 +2774,12 @@ setMethod("na.omit",
27692774

27702775
#' fillna - Replace null values.
27712776
#'
2772-
#' @param x A SparkDataFrame.
2773-
#' @param value Value to replace null values with.
2777+
#' @param value value to replace null values with.
27742778
#' Should be an integer, numeric, character or named list.
27752779
#' If the value is a named list, then cols is ignored and
27762780
#' value must be a mapping from column name (character) to
27772781
#' replacement value. The replacement value must be an
27782782
#' integer, numeric or character.
2779-
#' @param cols optional list of column names to consider.
2780-
#' Columns specified in cols that do not have matching data
2781-
#' type are ignored. For example, if value is a character, and
2782-
#' subset contains a non-character column, then the non-character
2783-
#' column is simply ignored.
27842783
#'
27852784
#' @rdname nafunctions
27862785
#' @name fillna
@@ -2845,8 +2844,11 @@ setMethod("fillna",
28452844
#' Since data.frames are held in memory, ensure that you have enough memory
28462845
#' in your system to accommodate the contents.
28472846
#'
2848-
#' @param x a SparkDataFrame
2849-
#' @return a data.frame
2847+
#' @param x a SparkDataFrame.
2848+
#' @param row.names NULL or a character vector giving the row names for the data frame.
2849+
#' @param optional If `TRUE`, converting column names is optional.
2850+
#' @param ... additional arguments passed to the method.
2851+
#' @return A data.frame.
28502852
#' @family SparkDataFrame functions
28512853
#' @aliases as.data.frame,SparkDataFrame-method
28522854
#' @rdname as.data.frame
@@ -3000,9 +3002,8 @@ setMethod("str",
30003002
#' Returns a new SparkDataFrame with columns dropped.
30013003
#' This is a no-op if schema doesn't contain column name(s).
30023004
#'
3003-
#' @param x A SparkDataFrame.
3004-
#' @param cols A character vector of column names or a Column.
3005-
#' @return A SparkDataFrame
3005+
#' @param col a character vector of column names or a Column.
3006+
#' @return A SparkDataFrame.
30063007
#'
30073008
#' @family SparkDataFrame functions
30083009
#' @rdname drop
@@ -3049,8 +3050,8 @@ setMethod("drop",
30493050
#'
30503051
#' @name histogram
30513052
#' @param nbins the number of bins (optional). Default value is 10.
3053+
#' @param col the column (described by character or Column object) to build the histogram from.
30523054
#' @param df the SparkDataFrame containing the Column to build the histogram from.
3053-
#' @param colname the name of the column to build the histogram from.
30543055
#' @return a data.frame with the histogram statistics, i.e., counts and centroids.
30553056
#' @rdname histogram
30563057
#' @aliases histogram,SparkDataFrame,characterOrColumn-method
@@ -3184,6 +3185,7 @@ setMethod("histogram",
31843185
#' @param x A SparkDataFrame
31853186
#' @param url JDBC database url of the form `jdbc:subprotocol:subname`
31863187
#' @param tableName The name of the table in the external database
3188+
#' @param ... additional argument(s) passed to the method
31873189
#' @param mode One of 'append', 'overwrite', 'error', 'ignore' save mode (it is 'error' by default)
31883190
#' @family SparkDataFrame functions
31893191
#' @rdname write.jdbc

0 commit comments

Comments
 (0)