Repository: spark Updated Branches: refs/heads/branch-2.0 8c2ec443b -> c527e9ed4
http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/R/pkg/R/generics.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/generics.R b/R/pkg/R/generics.R index 8416e5c..e7444ac 100644 --- a/R/pkg/R/generics.R +++ b/R/pkg/R/generics.R @@ -51,7 +51,7 @@ setGeneric("collectPartition", standardGeneric("collectPartition") }) -# @rdname count +# @rdname nrow # @export setGeneric("count", function(x) { standardGeneric("count") }) @@ -395,7 +395,7 @@ setGeneric("value", function(bcast) { standardGeneric("value") }) #################### SparkDataFrame Methods ######################## -#' @rdname agg +#' @rdname summarize #' @export setGeneric("agg", function (x, ...) { standardGeneric("agg") }) @@ -654,7 +654,7 @@ setGeneric("showDF", function(x, ...) { standardGeneric("showDF") }) # @export setGeneric("subset", function(x, ...) { standardGeneric("subset") }) -#' @rdname agg +#' @rdname summarize #' @export setGeneric("summarize", function(x, ...) { standardGeneric("summarize") }) @@ -1022,7 +1022,7 @@ setGeneric("month", function(x) { standardGeneric("month") }) #' @export setGeneric("months_between", function(y, x) { standardGeneric("months_between") }) -#' @rdname count +#' @rdname nrow #' @export setGeneric("n", function(x) { standardGeneric("n") }) http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/R/pkg/R/group.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/group.R b/R/pkg/R/group.R index 5ed7e8a..85348ae 100644 --- a/R/pkg/R/group.R +++ b/R/pkg/R/group.R @@ -47,6 +47,7 @@ groupedData <- function(sgd) { #' @rdname show +#' @aliases show,GroupedData-method #' @note show(GroupedData) since 1.4.0 setMethod("show", "GroupedData", function(object) { @@ -61,6 +62,7 @@ setMethod("show", "GroupedData", #' @param x a GroupedData #' @return a SparkDataFrame #' @rdname count +#' @aliases count,GroupedData-method #' @export #' @examples #' \dontrun{ @@ -84,6 +86,7 @@ setMethod("count", #' @param x a GroupedData #' @return a SparkDataFrame #' @rdname summarize +#' @aliases agg,GroupedData-method #' @name agg #' @family agg_funcs #' @export @@ -121,6 +124,7 @@ setMethod("agg", #' @rdname summarize #' @name summarize +#' @aliases summarize,GroupedData-method #' @note summarize since 1.4.0 setMethod("summarize", signature(x = "GroupedData"), @@ -146,6 +150,7 @@ methods <- c("avg", "max", "mean", "min", "sum") #' @param values A value or a list/vector of distinct values for the output columns. #' @return GroupedData object #' @rdname pivot +#' @aliases pivot,GroupedData,character-method #' @name pivot #' @export #' @examples @@ -198,6 +203,7 @@ createMethods() #' #' @param x A GroupedData #' @rdname gapply +#' @aliases gapply,GroupedData-method #' @name gapply #' @export #' @note gapply(GroupedData) since 2.0.0 @@ -212,6 +218,7 @@ setMethod("gapply", #' #' @param x A GroupedData #' @rdname gapplyCollect +#' @aliases gapplyCollect,GroupedData-method #' @name gapplyCollect #' @export #' @note gapplyCollect(GroupedData) since 2.0.0 @@ -243,4 +250,4 @@ gapplyInternal <- function(x, func, schema) { broadcastArr, if (class(schema) == "structType") { schema$jobj } else { NULL }) dataFrame(sdf) -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/R/pkg/R/mllib.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/mllib.R b/R/pkg/R/mllib.R index 94e1f65..50c601f 100644 --- a/R/pkg/R/mllib.R +++ b/R/pkg/R/mllib.R @@ -91,6 +91,7 @@ NULL #' \url{https://stat.ethz.ch/R-manual/R-devel/library/stats/html/family.html}. #' @param tol Positive convergence tolerance of iterations. #' @param maxIter Integer giving the maximal number of IRLS iterations. +#' @aliases spark.glm,SparkDataFrame,formula-method #' @return \code{spark.glm} returns a fitted generalized linear model #' @rdname spark.glm #' @name spark.glm @@ -306,6 +307,7 @@ setMethod("summary", signature(object = "NaiveBayesModel"), #' @param initMode The initialization algorithm choosen to fit the model #' @return \code{spark.kmeans} returns a fitted k-means model #' @rdname spark.kmeans +#' @aliases spark.kmeans,SparkDataFrame,formula-method #' @name spark.kmeans #' @export #' @examples @@ -418,6 +420,7 @@ setMethod("predict", signature(object = "KMeansModel"), #' @param smoothing Smoothing parameter #' @return \code{spark.naiveBayes} returns a fitted naive Bayes model #' @rdname spark.naiveBayes +#' @aliases spark.naiveBayes,SparkDataFrame,formula-method #' @name spark.naiveBayes #' @seealso e1071: \url{https://cran.r-project.org/web/packages/e1071/} #' @export @@ -512,7 +515,6 @@ setMethod("write.ml", signature(object = "GeneralizedLinearRegressionModel", pat #' which means throw exception if the output path exists. #' #' @rdname spark.kmeans -#' @name write.ml #' @export #' @note write.ml(KMeansModel, character) since 2.0.0 setMethod("write.ml", signature(object = "KMeansModel", path = "character"), http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/R/pkg/R/schema.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/schema.R b/R/pkg/R/schema.R index a91e998..b429f5d 100644 --- a/R/pkg/R/schema.R +++ b/R/pkg/R/schema.R @@ -26,6 +26,7 @@ #' @param x a structField object (created with the field() function) #' @param ... additional structField objects #' @return a structType object +#' @rdname structType #' @export #' @examples #'\dontrun{ @@ -40,13 +41,19 @@ structType <- function(x, ...) { UseMethod("structType", x) } -structType.jobj <- function(x) { +#' @rdname structType +#' @method structType jobj +#' @export +structType.jobj <- function(x, ...) { obj <- structure(list(), class = "structType") obj$jobj <- x obj$fields <- function() { lapply(callJMethod(obj$jobj, "fields"), structField) } obj } +#' @rdname structType +#' @method structType structField +#' @export structType.structField <- function(x, ...) { fields <- list(x, ...) if (!all(sapply(fields, inherits, "structField"))) { @@ -104,7 +111,10 @@ structField <- function(x, ...) { UseMethod("structField", x) } -structField.jobj <- function(x) { +#' @rdname structField +#' @method structField jobj +#' @export +structField.jobj <- function(x, ...) { obj <- structure(list(), class = "structField") obj$jobj <- x obj$name <- function() { callJMethod(x, "name") } @@ -179,7 +189,7 @@ checkType <- function(type) { #' @param nullable A logical vector indicating whether or not the field is nullable #' @rdname structField #' @export -structField.character <- function(x, type, nullable = TRUE) { +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/c527e9ed/R/pkg/R/stats.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/stats.R b/R/pkg/R/stats.R index c92352e..2b4ce19 100644 --- a/R/pkg/R/stats.R +++ b/R/pkg/R/stats.R @@ -34,6 +34,7 @@ setOldClass("jobj") #' #' @rdname crosstab #' @name crosstab +#' @aliases crosstab,SparkDataFrame,character,character-method #' @family stat functions #' @export #' @examples @@ -59,6 +60,7 @@ setMethod("crosstab", #' #' @rdname cov #' @name cov +#' @aliases cov,SparkDataFrame-method #' @family stat functions #' @export #' @examples @@ -88,6 +90,7 @@ setMethod("cov", #' #' @rdname corr #' @name corr +#' @aliases corr,SparkDataFrame-method #' @family stat functions #' @export #' @examples @@ -120,6 +123,7 @@ setMethod("corr", #' #' @rdname freqItems #' @name freqItems +#' @aliases freqItems,SparkDataFrame,character-method #' @family stat functions #' @export #' @examples @@ -158,6 +162,7 @@ setMethod("freqItems", signature(x = "SparkDataFrame", cols = "character"), #' #' @rdname approxQuantile #' @name approxQuantile +#' @aliases approxQuantile,SparkDataFrame,character,numeric,numeric-method #' @family stat functions #' @export #' @examples @@ -188,6 +193,7 @@ setMethod("approxQuantile", #' @return A new SparkDataFrame that represents the stratified sample #' #' @rdname sampleBy +#' @aliases sampleBy,SparkDataFrame,character,list,numeric-method #' @name sampleBy #' @family stat functions #' @export http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/R/pkg/R/utils.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/utils.R b/R/pkg/R/utils.R index e75bfbf..240b9f6 100644 --- a/R/pkg/R/utils.R +++ b/R/pkg/R/utils.R @@ -126,20 +126,16 @@ hashCode <- function(key) { as.integer(bitwXor(intBits[2], intBits[1])) } else if (class(key) == "character") { # TODO: SPARK-7839 means we might not have the native library available - if (is.loaded("stringHashCode")) { - .Call("stringHashCode", key) + n <- nchar(key) + if (n == 0) { + 0L } else { - n <- nchar(key) - if (n == 0) { - 0L - } else { - asciiVals <- sapply(charToRaw(key), function(x) { strtoi(x, 16L) }) - hashC <- 0 - for (k in 1:length(asciiVals)) { - hashC <- mult31AndAdd(hashC, asciiVals[k]) - } - as.integer(hashC) + asciiVals <- sapply(charToRaw(key), function(x) { strtoi(x, 16L) }) + hashC <- 0 + for (k in 1:length(asciiVals)) { + hashC <- mult31AndAdd(hashC, asciiVals[k]) } + as.integer(hashC) } } else { warning(paste("Could not hash object, returning 0", sep = "")) http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/R/pkg/R/window.R ---------------------------------------------------------------------- diff --git a/R/pkg/R/window.R b/R/pkg/R/window.R index d9d069c..215d0e7 100644 --- a/R/pkg/R/window.R +++ b/R/pkg/R/window.R @@ -28,6 +28,7 @@ #' #' @rdname windowPartitionBy #' @name windowPartitionBy +#' @aliases windowPartitionBy,character-method #' @export #' @examples #' \dontrun{ @@ -50,6 +51,7 @@ setMethod("windowPartitionBy", #' @rdname windowPartitionBy #' @name windowPartitionBy +#' @aliases windowPartitionBy,Column-method #' @export #' @note windowPartitionBy(Column) since 2.0.0 setMethod("windowPartitionBy", @@ -75,6 +77,7 @@ setMethod("windowPartitionBy", #' #' @rdname windowOrderBy #' @name windowOrderBy +#' @aliases windowOrderBy,character-method #' @export #' @examples #' \dontrun{ @@ -97,6 +100,7 @@ setMethod("windowOrderBy", #' @rdname windowOrderBy #' @name windowOrderBy +#' @aliases windowOrderBy,Column-method #' @export #' @note windowOrderBy(Column) since 2.0.0 setMethod("windowOrderBy", http://git-wip-us.apache.org/repos/asf/spark/blob/c527e9ed/dev/.rat-excludes ---------------------------------------------------------------------- diff --git a/dev/.rat-excludes b/dev/.rat-excludes index fb582de..0c86671 100644 --- a/dev/.rat-excludes +++ b/dev/.rat-excludes @@ -99,3 +99,4 @@ spark-deps-.* .*tsv org.apache.spark.scheduler.ExternalClusterManager .*\.sql +.Rbuildignore --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org