From 2d4074ad7ac3973e2c68679c9b99aee97135f1f6 Mon Sep 17 00:00:00 2001 From: egouldo Date: Tue, 16 Jul 2024 19:19:19 +1000 Subject: [PATCH] #24 roxygenise functions --- DESCRIPTION | 2 +- NAMESPACE | 8 ++++++++ man/calc_analyses_per_team.Rd | 26 +++++++++++++++++++++++ man/calc_summary_stats_binary.Rd | 28 +++++++++++++++++++++++++ man/calc_summary_stats_numeric.Rd | 34 +++++++++++++++++++++++++++++++ man/calc_teams_per_dataset.Rd | 26 +++++++++++++++++++++++ man/calculate_variable_counts.Rd | 29 ++++++++++++++++++++++++++ man/count_conclusions.Rd | 19 +++++++++++++++++ man/prepare_df_for_summarising.Rd | 28 +++++++++++++++++++++++++ 9 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 man/calc_analyses_per_team.Rd create mode 100644 man/calc_summary_stats_binary.Rd create mode 100644 man/calc_summary_stats_numeric.Rd create mode 100644 man/calc_teams_per_dataset.Rd create mode 100644 man/calculate_variable_counts.Rd create mode 100644 man/count_conclusions.Rd create mode 100644 man/prepare_df_for_summarising.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 8836c60..a521bb5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -70,6 +70,6 @@ LazyData: true Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 URL: https://github.com/egouldo/ManyEcoEvo, - https://egouldo.github.io/ManyEcoEvo/ + https://egouldo.github.io/ManyEcoEvo/ BugReports: https://github.com/egouldo/ManyEcoEvo/issues VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 4432ebe..92ce6d6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,8 +12,13 @@ export(augment_prediction_data) export(back_transform_response_vars_yi) export(box_cox_transform) export(calc_I2_ml) +export(calc_analyses_per_team) +export(calc_summary_stats_binary) +export(calc_summary_stats_numeric) +export(calc_teams_per_dataset) export(calculate_deviation_score) export(calculate_sorensen_diversity_index) +export(calculate_variable_counts) export(capwords) export(clean_response_transformation) export(compare_ml_MA) @@ -24,6 +29,7 @@ export(conversion_2) export(convert_predictions) export(count_analyses_variables_used) export(count_binary_coded_features) +export(count_conclusions) export(count_teams_analyses) export(cube_back) export(divide_back) @@ -63,6 +69,7 @@ export(power_back) export(pred_to_Z) export(prepare_ManyEcoEvo) export(prepare_ManyEcoEvo_yi) +export(prepare_df_for_summarising) export(prepare_diversity_raw) export(prepare_response_variables) export(prepare_response_variables_yi) @@ -132,6 +139,7 @@ importFrom(rlang,is_na) importFrom(rlang,is_null) importFrom(rlang,na_chr) importFrom(sae,bxcx) +importFrom(tibble,enframe) importFrom(tidyr,pivot_longer) importFrom(tidyr,pivot_wider) importFrom(tidyr,separate) diff --git a/man/calc_analyses_per_team.Rd b/man/calc_analyses_per_team.Rd new file mode 100644 index 0000000..96de984 --- /dev/null +++ b/man/calc_analyses_per_team.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{calc_analyses_per_team} +\alias{calc_analyses_per_team} +\title{Calculate total number of analyses per team for a given subset} +\usage{ +calc_analyses_per_team(data, subset_name = character(1L)) +} +\arguments{ +\item{data}{A tibble containing the data to be analysed.} + +\item{subset_name}{A character vector of length 1, the name of the subset of data being analysed.} +} +\value{ +A tibble containing the number of \code{analyses} per \code{team} for each \code{dataset} in a given \code{subset_name}. +} +\description{ +Calculates the number of analyses conducted by each team for each dataset in a given subset. +} +\examples{ +ManyEcoEvo::ManyEcoEvo \%>\% +select(data) \%>\% + unnest(everything()) \%>\% + prepare_df_for_summarising() \%>\% + calc_analyses_per_team("All") +} diff --git a/man/calc_summary_stats_binary.Rd b/man/calc_summary_stats_binary.Rd new file mode 100644 index 0000000..cc72b32 --- /dev/null +++ b/man/calc_summary_stats_binary.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{calc_summary_stats_binary} +\alias{calc_summary_stats_binary} +\title{Calculate summary statistics for binary summary variables} +\usage{ +calc_summary_stats_binary(data, subset_name = character(1L)) +} +\arguments{ +\item{data}{A tibble containing the data to be analysed.} + +\item{subset_name}{A character vector of length 1, the name of the subset of data being analysed.} +} +\value{ +A tibble containing the sum of binary variables used in analyses of each dataset for a given subset. +} +\description{ +Calculates the total number of analyses using linear models, mixed models, +and Bayesian models for each dataset, for a given subset. +See \code{\link[=prepare_df_for_summarising]{prepare_df_for_summarising()}} for details on the binary variables. +} +\examples{ +ManyEcoEvo::ManyEcoEvo \%>\% +select(data) \%>\% +unnest(everything()) \%>\% +prepare_df_for_summarising() \%>\% +calc_summary_stats_binary("All") +} diff --git a/man/calc_summary_stats_numeric.Rd b/man/calc_summary_stats_numeric.Rd new file mode 100644 index 0000000..ff768be --- /dev/null +++ b/man/calc_summary_stats_numeric.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{calc_summary_stats_numeric} +\alias{calc_summary_stats_numeric} +\title{Calculate summary statistics for numeric summary variables} +\usage{ +calc_summary_stats_numeric(data, subset_name = character(1L)) +} +\arguments{ +\item{data}{A tibble containing the data to be analysed.} + +\item{subset_name}{A character vector of length 1, the name of the subset of +data being analysed.} +} +\value{ +A tibble containing the mean, standard deviation, minimum and maximum +values for each numeric variable used in analyses of each dataset for a given subset. +} +\description{ +Calculates the mean, standard deviation, minimum and maximum for each numeric summary variable (See \code{\link[=prepare_df_for_summarising]{prepare_df_for_summarising()}}). + +for numeric +variables used in analyses of each dataset, for a given subset. +Summary statistics are aggregated across variable type \(Number of fixed variables +within the analysis, number of random variables within the analysis, +analysis samplesize, number of interaction terms within the analysis\). +} +\examples{ +ManyEcoEvo::ManyEcoEvo \%>\% +select(data) \%>\% + unnest(everything()) \%>\% + prepare_df_for_summarising() \%>\% + calc_summary_stats_numeric("All") +} diff --git a/man/calc_teams_per_dataset.Rd b/man/calc_teams_per_dataset.Rd new file mode 100644 index 0000000..8736ffe --- /dev/null +++ b/man/calc_teams_per_dataset.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{calc_teams_per_dataset} +\alias{calc_teams_per_dataset} +\title{Calculate the number of teams per dataset for a given subset} +\usage{ +calc_teams_per_dataset(data, subset_name = character(1L)) +} +\arguments{ +\item{data}{A tibble containing the data to be analysed.} + +\item{subset_name}{A character vector of length 1, the name of the subset of data being analysed.} +} +\value{ +A tibble containing the number of \code{teams} per \code{dataset} for a given \code{subset_name}. +} +\description{ +Calculate the number of teams per dataset for a given subset +} +\examples{ +ManyEcoEvo::ManyEcoEvo \%>\% +select(data) \%>\% +unnest(everything()) \%>\% +prepare_df_for_summarising() \%>\% +calc_teams_per_dataset("all") +} diff --git a/man/calculate_variable_counts.Rd b/man/calculate_variable_counts.Rd new file mode 100644 index 0000000..9df1989 --- /dev/null +++ b/man/calculate_variable_counts.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{calculate_variable_counts} +\alias{calculate_variable_counts} +\title{Count the number of times variables are used across analyses} +\usage{ +calculate_variable_counts(data, subset_name = character(1L)) +} +\arguments{ +\item{data}{A tibble of variables used in analyses of each dataset, for a given subset.} + +\item{subset_name}{A character vector of length 1, the name of the subset of data being analysed.} +} +\value{ +A tibble containing the number of times each variable is used across the analyses in the dataset. +} +\description{ +This function is used to count the number of times each variable is used across +the analyses in the dataset. The output is a tibble with the columns \code{variable} +and \code{count} which contains the number of times each variable is used across the +analyses in the dataset. +Count the number of times variables are used across analyses +} +\details{ +Takes a tibble of diversity data, i.e. data that is ready for computing Sorensen +diversity indices and computes the number of times each variable is used across +the analyses. Note, that the function does not group by dataset, as the layout of the +dataset assumes that each variable within a given dataset does not occur in another dataset. +} diff --git a/man/count_conclusions.Rd b/man/count_conclusions.Rd new file mode 100644 index 0000000..6f874de --- /dev/null +++ b/man/count_conclusions.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{count_conclusions} +\alias{count_conclusions} +\title{Count the number of different conclusions made by analysts across each dataset.} +\usage{ +count_conclusions(data, subset_name = character(1L)) +} +\arguments{ +\item{data}{A tibble containing the data to be analysed.} + +\item{subset_name}{A character vector of length 1, the name of the subset of data being analysed.} +} +\value{ +A tibble containing counts of each conclusion type made by analysts across each dataset, for a given subset. +} +\description{ +Count the number of different conclusions made by analysts across each dataset. +} diff --git a/man/prepare_df_for_summarising.Rd b/man/prepare_df_for_summarising.Rd new file mode 100644 index 0000000..71015e1 --- /dev/null +++ b/man/prepare_df_for_summarising.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calculate_descriptive_statistics.R +\name{prepare_df_for_summarising} +\alias{prepare_df_for_summarising} +\title{Prepare data for summarising descriptive statistics} +\usage{ +prepare_df_for_summarising(data) +} +\arguments{ +\item{data}{A tibble containing many-analyst data to be summarised.} +} +\value{ +A tibble containing the data prepared for summarising. +} +\description{ +Calculates the number of fixed variables, the number of random variables, +the sample size, the number of interactions, the number of linear models, +the number of generalised models, the number of fixed effects, and the number +of random effects for each analysis in the dataset. +Also codes whether each analysis employs a linear model, a generalised model, +or a Bayesian model. +} +\examples{ +ManyEcoEvo::ManyEcoEvo \%>\% +select(data) \%>\% +unnest(everything()) \%>\% +prepare_df_for_summarising() +}