kclus | R Documentation |
K-clustering
kclus(
dataset,
vars,
fun = "kmeans",
hc_init = TRUE,
distance = "sq.euclidian",
method = "ward.D",
seed = 1234,
nr_clus = 2,
standardize = TRUE,
lambda = NULL,
data_filter = "",
envir = parent.frame()
)
dataset |
Dataset |
vars |
Vector of variables to include in the analysis |
fun |
Use either "kmeans" or "kproto" for clustering |
hc_init |
Use centers from hclus as the starting point |
distance |
Distance for hclus |
method |
Method for hclus |
seed |
Random see to use for k-clustering if hc_init is FALSE |
nr_clus |
Number of clusters to extract |
standardize |
Standardize data (TRUE or FALSE) |
lambda |
Parameter > 0 to trade off between Euclidean distance of numeric variables and simple matching coefficient between categorical variables. Also a vector of variable specific factors is possible where the order must correspond to the order of the variables in the data. In this case all variables' distances will be multiplied by their corresponding lambda value. |
data_filter |
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000") |
envir |
Environment to extract data from |
See https://radiant-rstats.github.io/docs/multivariate/kclus.html for an example in Radiant
A list of all variables used in kclus as an object of class kclus
summary.kclus
to summarize results
plot.kclus
to plot results
store.kclus
to add cluster membership to the selected dataset
kclus(shopping, c("v1:v6"), nr_clus = 3) %>% str()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.