Skip to contents

Prepares the data for summarising Sorensen diversity indices across an entire study by unnesting the diversity indices and joining them to the prepared data in preparation for summarising subsets of data with summarise_study().

Usage

prepare_sorenson_summary_data(
  data,
  data_subset_name = "all",
  id_subsets = list(),
  subset_names = character(0L),
  filter_expressions = NULL
)

Arguments

data

A ManyAnalyst style tibble containing the data to be analysed.

data_subset_name

A character vector of length 1, the name of the subset of data.

id_subsets

A list of tibbles containing the id_col for each subset of data.

subset_names

A character vector equal to the length of id_subsets; the name of data subsets in id_subsets.

filter_expressions

A list of expressions to filter the data by.

Value

A tibble containing subsets of Sorensen diversity indices data.

Examples

id_subsets <- list(ManyEcoEvo:::effect_ids, ManyEcoEvo:::prediction_ids)
subset_names <- c("effects", "predictions")
filter_vars <- rlang::exprs(
  exclusion_set == "complete",
  estimate_type == "Zr",
  publishable_subset == "All",
  expertise_subset == "All",
  collinearity_subset == "All"
)
prepare_sorenson_summary_data(ManyEcoEvo::ManyEcoEvo_results,
  "all",
  id_subsets,
  subset_names,
  filter_expressions = filter_vars
)
#> # A tibble: 3 × 2
#>   data               subset_name
#>   <list>             <chr>      
#> 1 <tibble [210 × 4]> all        
#> 2 <tibble [210 × 4]> effects    
#> 3 <tibble [88 × 4]>  predictions