Debian Codegraph @

man/tidy.kmeans.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/stats-kmeans.R
3 \name{tidy.kmeans}
4 \alias{tidy.kmeans}
5 \alias{kmeans_tidiers}
6 \title{Tidy a(n) kmeans object}
7 \usage{
8 \method{tidy}{kmeans}(x, col.names = colnames(x$centers), ...)
9 }
10 \arguments{
11 \item{x}{A \code{kmeans} object created by \code{\link[stats:kmeans]{stats::kmeans()}}.}
12
13 \item{col.names}{Dimension names. Defaults to the names of the variables
14 in x. Set to NULL to get names \verb{x1, x2, ...}.}
15
16 \item{...}{Additional arguments. Not used. Needed to match generic
17 signature only. \strong{Cautionary note:} Misspelled arguments will be
18 absorbed in \code{...}, where they will be ignored. If the misspelled
19 argument has a default value, the default value will be used.
20 For example, if you pass \code{conf.lvel = 0.9}, all computation will
21 proceed using \code{conf.level = 0.95}. Two exceptions here are:
22 \itemize{
23 \item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if
24 it will be ignored.
25 \item \code{augment()} methods will warn when supplied a \code{newdata} argument if it
26 will be ignored.
27 }}
28 }
29 \description{
30 Tidy summarizes information about the components of a model.
31 A model component might be a single term in a regression, a single
32 hypothesis, a cluster, or a class. Exactly what tidy considers to be a
33 model component varies across models but is usually self-evident.
34 If a model has several distinct types of components, you will need to
35 specify which components to return.
36 }
37 \examples{
38 \dontshow{if (FALSE) withAutoprint(\{ # examplesIf}
39
40 library(cluster)
41 library(modeldata)
42 library(dplyr)
43
44 data(hpc_data)
45
46 x <- hpc_data[, 2:5]
47
48 fit <- pam(x, k = 4)
49
50 tidy(fit)
51 glance(fit)
52 augment(fit, x)
53 \dontshow{\}) # examplesIf}
54 }
55 \seealso{
56 \code{\link[=tidy]{tidy()}}, \code{\link[stats:kmeans]{stats::kmeans()}}
57
58 Other kmeans tidiers:
59 \code{\link{augment.kmeans}()},
60 \code{\link{glance.kmeans}()}
61 }
62 \concept{kmeans tidiers}
63 \value{
64 A \code{\link[tibble:tibble]{tibble::tibble()}} with columns:
65 \item{cluster}{A factor describing the cluster from 1:k.}
66 \item{size}{Number of points assigned to cluster.}
67 \item{withinss}{The within-cluster sum of squares.}
68
69 }