Hierarchical cluster analysis

hclus(dataset, vars, labels = "none", distance = "sq.euclidian",
  method = "ward.D", max_cases = 5000, standardize = TRUE,
  data_filter = "", envir = parent.frame())

Arguments

dataset

Dataset

vars

Vector of variables to include in the analysis

labels

A vector of labels for the leaves of the tree

distance

Distance

method

Method

max_cases

Maximum number of cases allowed (default is 1000). Set to avoid long-running analysis in the radiant web-interface

standardize

Standardized data (TRUE or FALSE)

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

Value

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

Details

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

See also

summary.hclus to summarize results

plot.hclus to plot results

Examples

hclus(shopping, vars = "v1:v6") %>% str()
#> List of 12 #> $ hc_out :List of 7 #> ..$ merge : int [1:19, 1:2] -10 -6 -3 -4 -5 -2 -12 -9 -1 1 ... #> ..$ height : num [1:19] 0.693 0.78 1.196 1.203 1.203 ... #> ..$ order : int [1:20] 3 8 15 17 1 12 6 7 2 13 ... #> ..$ labels : NULL #> ..$ method : chr "ward.D" #> ..$ call : language hclust(d = d, method = method) #> ..$ dist.method: chr "euclidean" #> ..- attr(*, "class")= chr "hclust" #> $ d : 'dist' num [1:190] 17.61 3.29 11.42 19.64 1.02 ... #> ..- attr(*, "Size")= int 20 #> ..- attr(*, "Diag")= logi FALSE #> ..- attr(*, "Upper")= logi FALSE #> ..- attr(*, "method")= chr "euclidean" #> ..- attr(*, "call")= language dist(x = dataset, method = "euclidean") #> $ anyCategorical: Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE #> ..- attr(*, "names")= chr [1:6] "v1" "v2" "v3" "v4" ... #> $ df_name : chr "shopping" #> $ dataset :'data.frame': 20 obs. of 6 variables: #> ..$ v1: num [1:20] 1.132 -0.974 1.658 0.079 -1.5 ... #> ..$ v2: num [1:20] -0.0709 -0.7799 -1.4888 1.3471 -0.7799 ... #> ..$ v3: num [1:20] 1.5156 -1.4659 1.0187 0.0248 -0.969 ... #> ..$ v4: num [1:20] -0.7245 -0.0659 -0.0659 0.5928 -1.3831 ... #> ..$ v5: num [1:20] -0.823 0.88 -1.391 -0.255 1.448 ... #> ..$ v6: num [1:20] -0.902 -0.234 -0.902 1.103 -0.234 ... #> $ vars : chr [1:6] "v1" "v2" "v3" "v4" ... #> $ labels : chr "none" #> $ distance : chr "sq.euclidian" #> $ method : chr "ward.D" #> $ max_cases : num 5000 #> $ standardize : logi TRUE #> $ data_filter : chr "" #> - attr(*, "class")= chr [1:2] "hclus" "list"