Learn R Programming

radiant (version 0.1.95)

kmeans_clus: K-means cluster analysis

Description

K-means cluster analysis

Usage

kmeans_clus(dataset, km_vars, data_filter = "", km_hc_init = TRUE, km_dist = "sq.euclidian", km_meth = "ward.D", km_seed = 1234, km_nr_clus = 2)

Arguments

dataset
Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant
km_vars
Vector of variables to include in the analysis
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")
km_hc_init
Use centers from hier_clus as the starting point
km_dist
Distance for hier_clus
km_meth
Method for hier_clus
km_seed
Random see to use for kmeans if km_hc_init is FALSE
km_nr_clus
Number of clusters to extract

Value

A list of all variables used in kmeans_clus as an object of class kmeans_clus

Details

See http://vnijs.github.io/radiant/marketing/kmeans_clus.html for an example in Radiant

See Also

summary.kmeans_clus to summarize results

plot.kmeans_clus to plot results

save_membership to add cluster membership to the selected dataset

Examples

Run this code
result <- kmeans_clus("shopping", c("v1:v6"))

Run the code above in your browser using DataLab