break_ward | R Documentation |
Quantize a one-dimensional variable by calling a clustering routine.
break_ward(x, n = 2, plot = T)
x |
a numerical vector |
n |
the desired number of bins |
plot |
If TRUE, a histogram with break lines is plotted
( |
method |
argument given to |
These are convenience routines which simply call the appropriate clustering
routine (ward
, hclust
, or kmeans
),
convert the output to a break vector, and make plots.
A break vector, suitable for use in cut
or
hist
.
Tom Minka
x <- c(rnorm(700,-2,1.5),rnorm(300,3,0.5)) break_ward(x,2) break_hclust(x,2,method="complete") break_kmeans(x,2) x <- c(rnorm(700,-2,0.5),rnorm(1000,2.5,1.5),rnorm(500,7,0.1)) break_ward(x,3) break_hclust(x,3,method="complete") break_kmeans(x,3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.