kclus: K-clustering

View source: R/kclus.R

kclusR Documentation

K-clustering

Description

K-clustering

Usage

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()
)

Arguments

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

Details

See https://radiant-rstats.github.io/docs/multivariate/kclus.html for an example in Radiant

Value

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

See Also

summary.kclus to summarize results

plot.kclus to plot results

store.kclus to add cluster membership to the selected dataset

Examples

kclus(shopping, c("v1:v6"), nr_clus = 3) %>% str()

radiant-rstats/radiant.multivariate documentation built on Nov. 29, 2023, 9:52 p.m.