View source: R/trans_sample_cluster.R
| sample_cluster | R Documentation |
Sample entire clusters defined by a categorical attribute.
sample_cluster(attribute, n_clusters, seed = NULL)
attribute |
cluster attribute name |
n_clusters |
number of clusters to sample |
seed |
optional random seed for reproducibility |
returns an object of class sample_cluster
data(iris)
sc <- sample_cluster("Species", n_clusters = 2, seed = 123)
iris_sc <- transform(sc, iris)
table(iris_sc$Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.