From 050c20cc9084bd6ef738fd808dad43139250f316 Mon Sep 17 00:00:00 2001 From: actuaryzhang <actuaryzhang10@gmail.com> Date: Fri, 3 Feb 2017 18:02:10 -0800 Subject: [PATCH] [SPARK-19386][SPARKR][FOLLOWUP] fix error in vignettes ## What changes were proposed in this pull request? Current version has error in vignettes: ``` model <- spark.bisectingKmeans(df, Sepal_Length ~ Sepal_Width, k = 4) summary(kmeansModel) ``` `kmeansModel` does not exist... felixcheung wangmiao1981 Author: actuaryzhang <actuaryzhang10@gmail.com> Closes #16799 from actuaryzhang/sparkRVignettes. --- R/pkg/vignettes/sparkr-vignettes.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/pkg/vignettes/sparkr-vignettes.Rmd b/R/pkg/vignettes/sparkr-vignettes.Rmd index a7cac2f503..f13e0b3a18 100644 --- a/R/pkg/vignettes/sparkr-vignettes.Rmd +++ b/R/pkg/vignettes/sparkr-vignettes.Rmd @@ -744,10 +744,10 @@ predictions <- predict(rfModel, df) `spark.bisectingKmeans` is a kind of [hierarchical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) using a divisive (or "top-down") approach: all observations start in one cluster, and splits are performed recursively as one moves down the hierarchy. -```{r} +```{r, warning=FALSE} df <- createDataFrame(iris) model <- spark.bisectingKmeans(df, Sepal_Length ~ Sepal_Width, k = 4) -summary(kmeansModel) +summary(model) fitted <- predict(model, df) head(select(fitted, "Sepal_Length", "prediction")) ``` -- GitLab