Estimate trait reliability

epidermal_trait_reliability(
  x,
  grouping.variable,
  heatmap = FALSE,
  thresholdval = 0.25
)

Arguments

x

A data.frame with the trait measurements and grouping variable (species or individual). Names of variables should be the same as those produced by extract_epidermal_traits()

grouping.variable

Character. Name of the column used to group images (e.g. individual, species)

heatmap

Logical. Plot a heatmap of trait reliability? Defaults to FALSE.

thresholdval

Numeric. Used for heatmap plotting only - what is the threshold for an 'unreliable' trait? Defaults to 0.25 (i.e. where the variation in one group exceeds 25 percent of the variation in the entire imageset)

Value

Either a list or data.frame, depending on the value of heatmap. If heatmap = TRUE, then a list of length 2 is returned, with a data.frame and the ggplot heatmap object. If heatmap = FALSE, only the data.frame is returned

Details

This function generates estimates of intra-species or intra- individual variability, expressed as a proportion of the variation in the entire imageset.

Examples

df <- epidermalmorph::podocarps
epidermal_trait_reliability(df, grouping.variable="individual")
#> # A tibble: 138 × 5
#> # Groups:   individual [3]
#>    individual         trait                        mean variation groupvar      
#>    <chr>              <fct>                       <dbl>     <dbl> <fct>         
#>  1 Acmopyle_pancheri1 dist.between.stom.rows     -1.06    0.171   Acmopyle_panc…
#>  2 Acmopyle_pancheri1 pavezone.AR.median          0.876   1.27    Acmopyle_panc…
#>  3 Acmopyle_pancheri1 pavezone.AR.sd              0.353   1.67    Acmopyle_panc…
#>  4 Acmopyle_pancheri1 pavezone.angle.median      -0.149   0.948   Acmopyle_panc…
#>  5 Acmopyle_pancheri1 pavezone.angle.sd          -0.685   0.637   Acmopyle_panc…
#>  6 Acmopyle_pancheri1 pavezone.area.median       -0.765   0.302   Acmopyle_panc…
#>  7 Acmopyle_pancheri1 pavezone.area.sd           -0.707   0.225   Acmopyle_panc…
#>  8 Acmopyle_pancheri1 pavezone.complexity.median -0.827   0.00964 Acmopyle_panc…
#>  9 Acmopyle_pancheri1 pavezone.complexity.sd     -0.864   0.0497  Acmopyle_panc…
#> 10 Acmopyle_pancheri1 pavezone.endwallangle.mean  0.160   0.570   Acmopyle_panc…
#> # … with 128 more rows