simulate_data {tglkmeans} | R Documentation |
Simulate normal data for kmeans tests
Description
Creates nclust
clusters normally distributed around 1:nclust
Usage
simulate_data(
n = 100,
sd = 0.3,
nclust = 30,
dims = 2,
frac_na = NULL,
add_true_clust = TRUE,
id_column = TRUE
)
Arguments
n |
number of observations per cluster |
sd |
sd |
nclust |
number of clusters |
dims |
number of dimensions |
frac_na |
fraction of NA in the first dimension |
add_true_clust |
add a column with the true cluster ids |
id_column |
add a column with the id |
Value
simulated data
Examples
simulate_data(n = 100, sd = 0.3, nclust = 5, dims = 2)
# add 20% missing data
simulate_data(n = 100, sd = 0.3, nclust = 5, dims = 2, frac_na = 0.2)
[Package tglkmeans version 0.5.5 Index]