aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorNarine Kokhlikyan <narine.kokhlikyan@gmail.com>2015-09-25 11:55:08 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-09-25 11:55:08 -0700
commit6fcee906d2afb5d5c3c49e0a669637a87e82b910 (patch)
tree723cb9ba29341338ed9b168a81f4338ea875dc29 /R
parent922338812c03eba43f2f1a6c414d1b6b049811cf (diff)
downloadspark-6fcee906d2afb5d5c3c49e0a669637a87e82b910.tar.gz
spark-6fcee906d2afb5d5c3c49e0a669637a87e82b910.tar.bz2
spark-6fcee906d2afb5d5c3c49e0a669637a87e82b910.zip
[SPARK-10760] [SPARKR] SparkR glm: the documentation in examples - family argument is missing
Hi everyone, Since the family argument is required for the glm function, the execution of: model <- glm(Sepal_Length ~ Sepal_Width, df) is failing. I've fixed the documentation by adding the family argument and also added the summay(model) which will show the coefficients for the model. Thanks, Narine Author: Narine Kokhlikyan <narine.kokhlikyan@gmail.com> Closes #8870 from NarineK/sparkrml.
Diffstat (limited to 'R')
-rw-r--r--R/pkg/R/mllib.R3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/pkg/R/mllib.R b/R/pkg/R/mllib.R
index 474ada5956..cd00bbbeec 100644
--- a/R/pkg/R/mllib.R
+++ b/R/pkg/R/mllib.R
@@ -41,7 +41,8 @@ setClass("PipelineModel", representation(model = "jobj"))
#' sqlContext <- sparkRSQL.init(sc)
#' data(iris)
#' df <- createDataFrame(sqlContext, iris)
-#' model <- glm(Sepal_Length ~ Sepal_Width, df)
+#' model <- glm(Sepal_Length ~ Sepal_Width, df, family="gaussian")
+#' summary(model)
#'}
setMethod("glm", signature(formula = "formula", family = "ANY", data = "DataFrame"),
function(formula, family = c("gaussian", "binomial"), data, lambda = 0, alpha = 0) {