Prepare data for summarising variable diversity
Source:R/calculate_descriptive_statistics.R
prepare_diversity_summary_data.Rd
Prepares the data for summarising variable diversity across an entire study by unnesting the
diversity data and joining them to the prepared data in preparation for
summarising subsets of data with summarise_study()
.
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 ofdata
.- subset_names
A character vector equal to the length of
id_subsets
; the name of data subsets inid_subsets
.
Examples
id_subsets <- list(ManyEcoEvo:::effect_ids, ManyEcoEvo:::prediction_ids)
subset_names <- c("effects", "predictions")
prepare_diversity_summary_data(
ManyEcoEvo::ManyEcoEvo,
"all",
id_subsets,
subset_names
) # TODO consider adding filter_expressions
#> # A tibble: 3 × 2
#> data subset_name
#> <list> <chr>
#> 1 <tibble [302 × 117]> all
#> 2 <tibble [210 × 117]> effects
#> 3 <tibble [88 × 117]> predictions