You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by fe...@apache.org on 2016/08/10 07:50:00 UTC
spark git commit: [MINOR][SPARKR] R API documentation for "coltypes"
is confusing
Repository: spark
Updated Branches:
refs/heads/master 9dc3e602d -> 1203c8415
[MINOR][SPARKR] R API documentation for "coltypes" is confusing
## What changes were proposed in this pull request?
R API documentation for "coltypes" is confusing, found when working on another ticket.
Current version http://spark.apache.org/docs/2.0.0/api/R/coltypes.html, where parameters have 2 "x" which is a duplicate, and also the example is not very clear


## How was this patch tested?
Tested manually on local machine. And the screenshots are like below:


Author: Xin Ren <ia...@126.com>
Closes #14489 from keypointt/rExample.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1203c841
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1203c841
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1203c841
Branch: refs/heads/master
Commit: 1203c8415cd11540f79a235e66a2f241ca6c71e4
Parents: 9dc3e60
Author: Xin Ren <ia...@126.com>
Authored: Wed Aug 10 00:49:06 2016 -0700
Committer: Felix Cheung <fe...@apache.org>
Committed: Wed Aug 10 00:49:06 2016 -0700
----------------------------------------------------------------------
R/pkg/R/DataFrame.R | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/1203c841/R/pkg/R/DataFrame.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R
index a473331..0ce4696 100644
--- a/R/pkg/R/DataFrame.R
+++ b/R/pkg/R/DataFrame.R
@@ -223,7 +223,7 @@ setMethod("showDF",
#' sparkR.session()
#' path <- "path/to/file.json"
#' df <- read.json(path)
-#' df
+#' show(df)
#'}
#' @note show(SparkDataFrame) since 1.4.0
setMethod("show", "SparkDataFrame",
@@ -368,7 +368,7 @@ setMethod("colnames<-",
#' @examples
#'\dontrun{
#' irisDF <- createDataFrame(iris)
-#' coltypes(irisDF)
+#' coltypes(irisDF) # get column types
#'}
#' @note coltypes since 1.6.0
setMethod("coltypes",
@@ -411,7 +411,6 @@ setMethod("coltypes",
#'
#' Set the column types of a SparkDataFrame.
#'
-#' @param x A SparkDataFrame
#' @param value A character vector with the target column types for the given
#' SparkDataFrame. Column types can be one of integer, numeric/double, character, logical, or NA
#' to keep that column as-is.
@@ -424,8 +423,8 @@ setMethod("coltypes",
#' sparkR.session()
#' path <- "path/to/file.json"
#' df <- read.json(path)
-#' coltypes(df) <- c("character", "integer")
-#' coltypes(df) <- c(NA, "numeric")
+#' coltypes(df) <- c("character", "integer") # set column types
+#' coltypes(df) <- c(NA, "numeric") # set column types
#'}
#' @note coltypes<- since 1.6.0
setMethod("coltypes<-",
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org