-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20889][SparkR] Grouped documentation for AGGREGATE column methods #18025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ab6e4f1
0044b29
014b9f3
36203df
0a7f5fc
19d063c
978e13b
875db0d
79d9fdf
6eae126
4cf5ab9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,22 +52,17 @@ setMethod("crosstab", | |
| collect(dataFrame(sct)) | ||
| }) | ||
|
|
||
| #' Calculate the sample covariance of two numerical columns of a SparkDataFrame. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, this is one of the tricky ones where there is one page for DataFrame & Columns.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. in that case can we add this in the |
||
| #' | ||
| #' @param colName1 the name of the first column | ||
| #' @param colName2 the name of the second column | ||
| #' @return The covariance of the two columns. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what would the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I added this back. The doc should be very clear even without this return value. Indeed, most functions do not document return value in SparkR. See what it looks like in the image above.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly, but better clarity wouldn't hurt, right? |
||
| #' | ||
| #' @rdname cov | ||
| #' @name cov | ||
| #' @aliases cov,SparkDataFrame-method | ||
| #' @family stat functions | ||
| #' @export | ||
| #' @examples | ||
| #'\dontrun{ | ||
| #' df <- read.json("/path/to/file.json") | ||
| #' cov <- cov(df, "title", "gender") | ||
| #' } | ||
| #' | ||
| #' \dontrun{ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't the newline be after the dontrun?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. The newline should be between |
||
| #' cov(df, "mpg", "hp")} | ||
| #' @note cov since 1.6.0 | ||
| setMethod("cov", | ||
| signature(x = "SparkDataFrame"), | ||
|
|
@@ -93,11 +88,10 @@ setMethod("cov", | |
| #' @family stat functions | ||
| #' @export | ||
| #' @examples | ||
| #'\dontrun{ | ||
| #' df <- read.json("/path/to/file.json") | ||
| #' corr <- corr(df, "title", "gender") | ||
| #' corr <- corr(df, "title", "gender", method = "pearson") | ||
| #' } | ||
| #' | ||
| #' \dontrun{ | ||
| #' corr(df, "mpg", "hp") | ||
| #' corr(df, "mpg", "hp", method = "pearson")} | ||
| #' @note corr since 1.6.0 | ||
| setMethod("corr", | ||
| signature(x = "SparkDataFrame"), | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need space/newline in front of this example like the other ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one does not need the extra newline since it's in its own Rd and there are no examples before it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great - I know we talk about it, but we might consider getting all examples on the Rd into one
\dontrunblock again. as of now it's very hard to review new PR without knowing whether a newline is needed or not...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe we should have a newline at the end of every
@exampleblock (when there are multiple examples on one Rd)? This way we don't have to know where goes first