Estimates R^2 (r-squared) values for a range of number of profiles

estimate_r_squared(df, ..., to_center = FALSE, to_scale = FALSE,
  distance_metric = "squared_euclidean", linkage = "complete",
  lower_bound = 2, upper_bound = 9, r_squared_table = TRUE)

Arguments

df

with two or more columns with continuous variables

...

unquoted variable names separated by commas

to_center

(TRUE or FALSE) for whether to center the raw data with M = 0

to_scale

Boolean (TRUE or FALSE) for whether to scale the raw data with SD = 1

distance_metric

Distance metric to use for hierarchical clustering; "squared_euclidean" is default but more options are available (see ?hclust)

linkage

Linkage method to use for hierarchical clustering; "complete" is default but more options are available (see ?dist)

lower_bound

the smallest number of profiles in the range of number of profiles to explore; defaults to 2

upper_bound

the largest number of profiles in the range of number of profiles to explore; defaults to 9

r_squared_table

if TRUE (default), then a table, rather than a plot, is returned; defaults to FALSE

Value

A list containing a ggplot2 object and a tibble for the R^2 values

Details

Returns ggplot2 plot of cluster centroids