Skip to content

Commit

Permalink
use first line as the title convention
Browse files Browse the repository at this point in the history
  • Loading branch information
vectorijk committed Jun 14, 2016
1 parent 9629184 commit 560ff0e
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 37 deletions.
32 changes: 20 additions & 12 deletions R/pkg/R/DataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ NULL
setOldClass("jobj")
setOldClass("structType")

#' @title S4 class that represents a SparkDataFrame
#' @description DataFrames can be created using functions like \link{createDataFrame},
#' \link{read.json}, \link{table} etc.
#' S4 class that represents a SparkDataFrame
#'
#' DataFrames can be created using functions like \link{createDataFrame},
#' \link{read.json}, \link{table} etc.
#'
#' @family SparkDataFrame functions
#' @rdname SparkDataFrame
#' @docType class
Expand Down Expand Up @@ -1940,8 +1942,9 @@ setMethod("join",
dataFrame(sdf)
})

#' Merges two data frames
#'
#' @name merge
#' @title Merges two data frames
#' @param x the first data frame to be joined
#' @param y the second data frame to be joined
#' @param by a character vector specifying the join columns. If by is not
Expand Down Expand Up @@ -2111,8 +2114,9 @@ setMethod("unionAll",
dataFrame(unioned)
})

#' @title Union two or more SparkDataFrames
#' @description Returns a new SparkDataFrame containing rows of all parameters.
#' Union two or more SparkDataFrames
#'
#' Returns a new SparkDataFrame containing rows of all parameters.
#'
#' @rdname rbind
#' @name rbind
Expand Down Expand Up @@ -2474,11 +2478,12 @@ setMethod("fillna",
dataFrame(sdf)
})

#' Download data from a SparkDataFrame into a data.frame
#'
#' This function downloads the contents of a SparkDataFrame into an R's data.frame.
#' Since data.frames are held in memory, ensure that you have enough memory
#' in your system to accommodate the contents.
#'
#' @title Download data from a SparkDataFrame into a data.frame
#' @param x a SparkDataFrame
#' @return a data.frame
#' @family SparkDataFrame functions
Expand All @@ -2494,13 +2499,14 @@ setMethod("as.data.frame",
as.data.frame(collect(x), row.names, optional, ...)
})

#' Attach SparkDataFrame to R search path
#'
#' The specified SparkDataFrame is attached to the R search path. This means that
#' the SparkDataFrame is searched by R when evaluating a variable, so columns in
#' the SparkDataFrame can be accessed by simply giving their names.
#'
#' @family SparkDataFrame functions
#' @rdname attach
#' @title Attach SparkDataFrame to R search path
#' @param what (SparkDataFrame) The SparkDataFrame to attach
#' @param pos (integer) Specify position in search() where to attach.
#' @param name (character) Name to use for the attached SparkDataFrame. Names
Expand All @@ -2520,7 +2526,7 @@ setMethod("attach",
attach(newEnv, pos = pos, name = name, warn.conflicts = warn.conflicts)
})

#' Evaluate an expression in an environment constructed from SparkDataFrame
#' Evaluate a R expression in an environment constructed from a SparkDataFrame
#'
#' Evaluate a R expression in an environment constructed from a SparkDataFrame
#' with() allows access to columns of a SparkDataFrame by simply referring to
Expand All @@ -2530,7 +2536,6 @@ setMethod("attach",
#'
#' @rdname with
#' @family SparkDataFrame functions
#' @title Evaluate a R expression in an environment constructed from a SparkDataFrame
#' @param data (SparkDataFrame) SparkDataFrame to use for constructing an environment.
#' @param expr (expression) Expression to evaluate.
#' @param ... arguments to be passed to future methods.
Expand All @@ -2546,10 +2551,12 @@ setMethod("with",
eval(substitute(expr), envir = newEnv, enclos = newEnv)
})

#' Compactly display the structure of a dataset
#'
#' Display the structure of a SparkDataFrame, including column names, column types, as well as a
#' a small sample of rows.
#'
#' @name str
#' @title Compactly display the structure of a dataset
#' @rdname str
#' @family SparkDataFrame functions
#' @param object a SparkDataFrame
Expand Down Expand Up @@ -2662,10 +2669,11 @@ setMethod("drop",
base::drop(x)
})

#' Histogram
#'
#' This function computes a histogram for a given SparkR Column.
#'
#' @name histogram
#' @title Histogram
#' @param nbins the number of bins (optional). Default value is 10.
#' @param df the SparkDataFrame containing the Column to build the histogram from.
#' @param colname the name of the column to build the histogram from.
Expand Down
6 changes: 4 additions & 2 deletions R/pkg/R/RDD.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@

setOldClass("jobj")

#' @title S4 class that represents an RDD
#' @description RDD can be created using functions like
#' S4 class that represents an RDD
#'
#' RDD can be created using functions like
#' \code{parallelize}, \code{textFile} etc.
#'
#' @rdname RDD
#' @seealso parallelize, textFile
#' @slot env An R environment that stores bookkeeping states of the RDD
Expand Down
7 changes: 4 additions & 3 deletions R/pkg/R/WindowSpec.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#' @include generics.R jobj.R column.R
NULL

#' @title S4 class that represents a WindowSpec
#' @description WindowSpec can be created by using window.partitionBy()
#' or window.orderBy()
#' S4 class that represents a WindowSpec
#'
#' WindowSpec can be created by using window.partitionBy() or window.orderBy()
#'
#' @rdname WindowSpec
#' @seealso \link{window.partitionBy}, \link{window.orderBy}
#'
Expand Down
8 changes: 5 additions & 3 deletions R/pkg/R/broadcast.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
.broadcastValues <- new.env()
.broadcastIdToName <- new.env()

# @title S4 class that represents a Broadcast variable
# @description Broadcast variables can be created using the broadcast
# function from a \code{SparkContext}.
# S4 class that represents a Broadcast variable
#
# Broadcast variables can be created using the broadcast
# function from a \code{SparkContext}.
#
# @rdname broadcast-class
# @seealso broadcast
#
Expand Down
6 changes: 4 additions & 2 deletions R/pkg/R/column.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ NULL

setOldClass("jobj")

#' @title S4 class that represents a SparkDataFrame column
#' @description The column class supports unary, binary operations on SparkDataFrame columns
#' S4 class that represents a SparkDataFrame column
#'
#' The column class supports unary, binary operations on SparkDataFrame columns
#'
#' @rdname column
#'
#' @slot jc reference to JVM SparkDataFrame column
Expand Down
8 changes: 3 additions & 5 deletions R/pkg/R/context.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ includePackage <- function(sc, pkg) {
.sparkREnv$.packages <- packages
}

#' @title Broadcast a variable to all workers
#' Broadcast a variable to all workers
#'
#' @description
#' Broadcast a read-only variable to the cluster, returning a \code{Broadcast}
#' object for reading it in distributed functions.
#'
Expand Down Expand Up @@ -207,7 +206,7 @@ broadcast <- function(sc, object) {
Broadcast(id, object, jBroadcast, objName)
}

#' @title Set the checkpoint directory
#' Set the checkpoint directory
#'
#' Set the directory under which RDDs are going to be checkpointed. The
#' directory must be a HDFS path if running on a cluster.
Expand All @@ -226,9 +225,8 @@ setCheckpointDir <- function(sc, dirName) {
invisible(callJMethod(sc, "setCheckpointDir", suppressWarnings(normalizePath(dirName))))
}

#' @title Run a function over a list of elements, distributing the computations with Spark.
#' Run a function over a list of elements, distributing the computations with Spark.
#'
#' @description
#' Applies a function in a manner that is similar to doParallel or lapply to elements of a list.
#' The computations are distributed using Spark. It is conceptually the same as the following code:
#' lapply(list, func)
Expand Down
6 changes: 4 additions & 2 deletions R/pkg/R/group.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ NULL

setOldClass("jobj")

#' @title S4 class that represents a GroupedData
#' @description GroupedDatas can be created using groupBy() on a SparkDataFrame
#' S4 class that represents a GroupedData
#'
#' GroupedDatas can be created using groupBy() on a SparkDataFrame
#'
#' @rdname GroupedData
#' @seealso groupBy
#'
Expand Down
24 changes: 16 additions & 8 deletions R/pkg/R/mllib.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,26 @@
# - a set of methods that reflect the arguments of the other languages supported by Spark. These
# methods are prefixed with the `spark.` prefix: spark.glm, spark.kmeans, etc.

#' @title S4 class that represents a generalized linear model
#' S4 class that represents a generalized linear model
#'
#' @param jobj a Java object reference to the backing Scala GeneralizedLinearRegressionWrapper
#' @export
setClass("GeneralizedLinearRegressionModel", representation(jobj = "jobj"))

#' @title S4 class that represents a NaiveBayesModel
#' S4 class that represents a NaiveBayesModel
#'
#' @param jobj a Java object reference to the backing Scala NaiveBayesWrapper
#' @export
setClass("NaiveBayesModel", representation(jobj = "jobj"))

#' @title S4 class that represents a AFTSurvivalRegressionModel
#' S4 class that represents a AFTSurvivalRegressionModel
#'
#' @param jobj a Java object reference to the backing Scala AFTSurvivalRegressionWrapper
#' @export
setClass("AFTSurvivalRegressionModel", representation(jobj = "jobj"))

#' @title S4 class that represents a KMeansModel
#' S4 class that represents a KMeansModel
#'
#' @param jobj a Java object reference to the backing Scala KMeansModel
#' @export
setClass("KMeansModel", representation(jobj = "jobj"))
Expand Down Expand Up @@ -197,10 +201,11 @@ print.summary.GeneralizedLinearRegressionModel <- function(x, ...) {
invisible(x)
}

#' predict
#'
#' Makes predictions from a generalized linear model produced by glm() or spark.glm(),
#' similarly to R's predict().
#'
#' @title predict
#' @param object A fitted generalized linear model
#' @param newData SparkDataFrame for testing
#' @return SparkDataFrame containing predicted labels in a column named "prediction"
Expand All @@ -217,10 +222,11 @@ setMethod("predict", signature(object = "GeneralizedLinearRegressionModel"),
return(dataFrame(callJMethod(object@jobj, "transform", newData@sdf)))
})

#' predict
#'
#' Makes predictions from a naive Bayes model or a model produced by spark.naiveBayes(),
#' similarly to R package e1071's predict.
#'
#' @title predict
#' @param object A fitted naive Bayes model
#' @param newData SparkDataFrame for testing
#' @return SparkDataFrame containing predicted labels in a column named "prediction"
Expand Down Expand Up @@ -355,9 +361,10 @@ setMethod("summary", signature(object = "KMeansModel"),
cluster = cluster, is.loaded = is.loaded))
})

#' predict
#'
#' Makes predictions from a k-means model or a model produced by spark.kmeans().
#'
#' @title predict
#' @param object A fitted k-means model
#' @param newData SparkDataFrame for testing
#' @return SparkDataFrame containing predicted labels in a column named "prediction"
Expand Down Expand Up @@ -579,10 +586,11 @@ setMethod("summary", signature(object = "AFTSurvivalRegressionModel"),
return(list(coefficients = coefficients))
})

#' predict
#'
#' Makes predictions from an AFT survival regression model or a model produced by spark.survreg(),
#' similarly to R package survival's predict.
#'
#' @title predict
#' @param object A fitted AFT survival regression model
#' @param newData SparkDataFrame for testing
#' @return SparkDataFrame containing predicted labels in a column named "prediction"
Expand Down

0 comments on commit 560ff0e

Please sign in to comment.