man_multi: Calculate mid value statistic for each group in the distance...

Description Usage Arguments Value Examples

View source: R/albatross_functions.R

Description

Calculate mid value statistic for each group in the distance matrix over a grid of cut offs

Usage

1
2
man_multi(dist_mat, cut_offs = seq(0, 1, length.out = 100),
  group = unique(colnames(dist_mat)), res = 3)

Arguments

dist_mat

A [0, 1] bounded square distance matrix with column names matching groups.

cut_offs

An ordered (low to high) sequence of cut_offs to calculate mid values.

group

A character vector specifying groups of interest. Defualt is all groups.

res

The number of digits to round mid values to. Helpful when plateaus occur.

Value

A tibble containing the following columns: cut_offs - [0,1] cut off values input by user mids - the mid values for each cut off group - the group id taken from the column names of the input distance matrix

Examples

1
2
3
4
5
6
sepal_dist <- iris$Sepal.Width %>% dist() %>% as.matrix()
sepal_dist <- sepal_dist/max(sepal_dist)
colnames(sepal_dist) <- iris$Species
cut_df <- man_multi(dist_mat = sepal_dist, res = 2)
ggplot(cut_df, aes(cut_offs, cut_df$mids, colour = group)) + 
geom_line()

silastittes/albatross documentation built on April 19, 2018, 3:31 a.m.