dendro: Make a dendrogram

View source: R/plot_tools.R

dendroR Documentation

Make a dendrogram

Description

Make a dendrogram

Usage

dendro(
  df,
  clust_method = "ave",
  dist_method = "euclidean",
  labels = NULL,
  main = NULL,
  sub = NULL,
  cex = 0.8
)

Arguments

df

(Dataframe or Matrix) The data, arranged in wide format. Non-numeric data will be coerced into NAs.

clust_method

(Character) the agglomeration method to be used. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC).

dist_method

(Character) the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given.

labels

(Character) Text to use as the tip labels.

main

(Character) Chart title.

sub

(Character) Chart subtitle.

cex

(Numeric) Size magnification. 0.8 is 80 percent of the base value.

Value

An object of class hclust.

Examples

## Not run: 
df <- data.frame(stringsAsFactors = FALSE,
                 site = c("a", "b", "c", "d"),
                 spp1 = c(0L, 1L, 1L, 0L),
                 spp2 = c(1L, 1L, 1L, 0L),
                 spp3 = c(0L, 0L, 1L, 0L))

dendro(df[2:4], labels = df$site)

## End(Not run)


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.