Skip to contents

Count number of analyses each variable is used

Usage

count_analyses_variables_used(data)

Arguments

data

A dataframe containing the variables dataset, id_col and columns filled with the name of the variable indicating variable usage.

Value

A dataframe of counts n each variable is used across all analyses within a given dataset

Details

Values in variable columns are character strings or NA. NA values are treated as absence of variable in a given analysis (observation / row), while character strings are treated as presence of that variable in a given analysis.

Variable presence in an analysis is converted to numeric 1's/0's and then summed to calculate total times the analysis is used across all analyses (n).

Author

Hannah S. Fraser

Elliot Gould

Examples

library(ManyEcoEvo)
ManyEcoEvo %>%
  select(diversity_data) %>%
  tidyr::unnest(diversity_data) %>%
  count_analyses_variables_used()
#> Error in select(., diversity_data): could not find function "select"