Description Usage Arguments Value Examples
This function performs unsupervised clustering on a dataset. This technique can be useful to detect hidden trends in the data, as well as outliers and odd behaviors. Works best with smaller datasets - more than a few thousand can slow greatly and be less useful
1 2 | UnsupervisedClusters(datain, plottype = "fan", forceclusters = NULL,
classification = NULL)
|
datain |
a dataframe which will be clustered |
plottype |
one of the following: "dendogram", "fan", "radial","unrooted","cladogram" |
forceclusters |
allows for specification of number of clusters. If NULL, the best number will be calculated. |
classification |
optional - a vector with true class values. If given, a confusion matrix will be output |
datain, but with an added column with clusters
1 2 3 4 5 6 7 8 9 | set.seed(1)
datain <- data.frame(matrix(rnorm(400), nrow=100))
dataout <- UnsupervisedClusters(datain)
dataout$index <- 1:length(dataout[,1])
graphme <- reshape::melt(dataout, id=c("index", "cluster"))
ggplot2::ggplot(graphme, ggplot2::aes(x=index, y=value, color=cluster)) +
ggplot2::geom_point() + ggplot2::facet_wrap(~variable) + theme_GR()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.