Skip to contents

Computes summary statistics for each clade and/or each clock partition. The input must have a "clade" column.

Usage

clockrate_summary(rate_table, file = NULL, digits = 3)

Arguments

rate_table

A data frame of clock rates, such as from the output of get_clockrate_table_MrBayes with an extra "clade" column.

file

An optional file path where the resulting table will be stored using write.csv.

digits

The number of digits to round the summary results to. Default is 3. See round.

Details

The user must manually add clades to the rate table produced by get_clockrate_table_MrBayes before it can be used with this function. This can be doen manually within R, such as by using a graphical user interface for editing data like the DataEditR package, or by writing the rate table to a spreadsheet and reading it back in after adding the clades. The example below uses a table that has had the clades added.

Value

A data frame containing a row for each clade and each clock with summary statistics (n, mean, standard deviation, minimum, 1st quartile, median, third quartile, maximum).

See also

vignette("rates-selection") for the use of this function as part of an analysis pipeline.

get_clockrate_table_MrBayes, summary

Examples

# See vignette("rates-selection") for how to use this
# function as part of an analysis pipeline

data("RateTable_Means_3p_Clades")

clockrate_summary(RateTable_Means_3p_Clades)
#>                clade clock  n  mean    sd   min    Q1 median    Q3   max
#> 1        Dipnomorpha     1  8 1.100 0.110 0.944 1.020  1.098 1.194 1.231
#> 2     Elpisostegalia     1 14 1.605 0.216 1.133 1.451  1.682 1.797 1.806
#> 3     Osteolepididae     1 11 0.632 0.264 0.165 0.442  0.811 0.836 0.872
#> 4      Rhizodontidae     1 14 0.572 0.304 0.030 0.330  0.667 0.834 0.890
#> 5  Tristichopteridae     1 21 0.714 0.036 0.615 0.695  0.722 0.739 0.782
#> 6              Other     1 11 0.885 0.358 0.541 0.689  0.782 0.941 1.807
#> 7        Dipnomorpha     2  8 0.751 0.181 0.518 0.624  0.747 0.891 0.981
#> 8     Elpisostegalia     2 14 1.361 0.099 1.029 1.360  1.377 1.412 1.423
#> 9     Osteolepididae     2 11 0.345 0.153 0.066 0.278  0.382 0.452 0.532
#> 10     Rhizodontidae     2 14 0.327 0.183 0.019 0.174  0.384 0.443 0.557
#> 11 Tristichopteridae     2 21 0.342 0.059 0.270 0.315  0.327 0.332 0.545
#> 12             Other     2 11 0.747 0.253 0.388 0.610  0.717 0.782 1.352
#> 13       Dipnomorpha     3  8 0.869 0.110 0.720 0.791  0.887 0.948 1.006
#> 14    Elpisostegalia     3 14 0.834 0.163 0.626 0.671  0.892 0.987 1.001
#> 15    Osteolepididae     3 11 0.320 0.128 0.074 0.274  0.333 0.416 0.486
#> 16     Rhizodontidae     3 14 0.318 0.167 0.022 0.205  0.395 0.429 0.521
#> 17 Tristichopteridae     3 21 0.520 0.085 0.374 0.435  0.536 0.586 0.639
#> 18             Other     3 11 0.731 0.166 0.466 0.640  0.699 0.813 1.002