From 5c5cf5e4b2ec0503972ccf528ea11da87a60a90c Mon Sep 17 00:00:00 2001 From: Sun Rui Date: Wed, 13 May 2015 10:37:56 +0800 Subject: [PATCH] Implement alias loadDF() as a new function. --- R/pkg/R/SQLContext.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/pkg/R/SQLContext.R b/R/pkg/R/SQLContext.R index 2db34a98b2e73..531442e8459e4 100644 --- a/R/pkg/R/SQLContext.R +++ b/R/pkg/R/SQLContext.R @@ -446,7 +446,6 @@ dropTempTable <- function(sqlCtx, tableName) { #' @param source the name of external data source #' @return DataFrame #' @export -#' @aliases loadDF #' @examples #'\dontrun{ #' sc <- sparkR.init() @@ -454,7 +453,7 @@ dropTempTable <- function(sqlCtx, tableName) { #' df <- read.df(sqlCtx, "path/to/file.json", source = "json") #' } -read.df <- loadDF <- function(sqlCtx, path = NULL, source = NULL, ...) { +read.df <- function(sqlCtx, path = NULL, source = NULL, ...) { options <- varargsToEnv(...) if (!is.null(path)) { options[['path']] <- path @@ -463,6 +462,13 @@ read.df <- loadDF <- function(sqlCtx, path = NULL, source = NULL, ...) { dataFrame(sdf) } +#' @aliases loadDF +#' @export + +loadDF <- function(sqlCtx, path = NULL, source = NULL, ...) { + read.df(sqlCtx, path, source, ...) +} + #' Create an external table #' #' Creates an external table based on the dataset in a data source,