diff --git a/R/summarise_analysis_types.R b/R/summarise_analysis_types.R index 2d1f533..f5f1ecc 100644 --- a/R/summarise_analysis_types.R +++ b/R/summarise_analysis_types.R @@ -12,22 +12,11 @@ #' #' @return A summarised tibble with the variables `subset`, `dataset`, `num_teams`, `total_analyses`, `sum_linear`, `sum_mixed`, `sum_Bayesian`. #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr select -#' @importFrom dplyr group_by -#' @importFrom dplyr rename -#' @importFrom purrr map -#' @importFrom broom tidy -#' @importFrom tidyr unnest -#' @importFrom magrittr "%>%" -#' @importFrom dplyr distinct -#' @importFrom dplyr mutate +#' @import dplyr +#' @import broom +#' @import tidyr #' @import metafor -#' @importFrom dplyr across -#' @importFrom dplyr left_join -#' @importFrom dplyr right_join -#' @importFrom dplyr full_join -#' @importFrom purrr map_dfr +#' @import purrr #' @family Multi-dataset Wrapper Functions #' @author Hannah S. Fraser #' @author Elliot Gould @@ -128,10 +117,7 @@ summarise_analysis_types <- function(ManyEcoEvo_results, ManyEcoEvo_yi_results, #' #' @return A dataframe with the columns `dataset`, `total_teams` and `total_analyses` equal in number of rows to the number of unique values within the `dataset` variable of the input `data`. #' @export -#' @importFrom dplyr count -#' @importFrom dplyr group_by -#' @importFrom dplyr summarise -#' @importFrom magrittr "%>%" +#' @import dplyr #' @author Hannah S. Fraser #' @author Elliot Gould #' @examples @@ -157,9 +143,7 @@ count_teams_analyses <- function(data) { #' #' @return A dataframe with the variables #' @export -#' @importFrom dplyr group_by -#' @importFrom dplyr summarise -#' @importFrom magrittr "%>%" +#' @import dplyr #' @author Hannah S. Fraser #' @author Elliot Gould #' @examples diff --git a/R/summarise_conclusions.R b/R/summarise_conclusions.R index e3a12a0..7b47a19 100644 --- a/R/summarise_conclusions.R +++ b/R/summarise_conclusions.R @@ -6,30 +6,20 @@ #' @param ManyEcoEvo_results A tibble of `ManyEcoEvo_results` #' @param ManyEcoEvo_yi_results A tibble of `ManyEcoEvo_yi_results` #' @param ManyEcoEvo A tibble of `ManyEcoEvo` -#' #' @return A dataframe with count values for each unique `Conclusion` in columns for each `subset` ("effects", "predictions", "all"), for each `dataset`. #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr select -#' @importFrom dplyr group_by -#' @importFrom dplyr rename -#' @importFrom purrr map -#' @importFrom broom tidy -#' @importFrom tidyr unnest -#' @importFrom magrittr "%>%" -#' @importFrom dplyr distinct -#' @importFrom dplyr mutate +#' @import dplyr +#' @import purrr +#' @import broom +#' @import tidyr #' @import metafor -#' @importFrom dplyr across -#' @importFrom dplyr left_join -#' @importFrom dplyr right_join -#' @importFrom dplyr full_join -#' @importFrom purrr map_dfr -#' @importFrom tidyr pivot_wider #' @family Multi-dataset Wrapper Functions #' @author Hannah S. Fraser #' @author Elliot Gould #' @examples +#' data(ManyEcoEvo_results) +#' data(ManyEcoEvo_yi_results) +#' data(ManyEcoEvo) #' summarise_conclusions(ManyEcoEvo_results, ManyEcoEvo_yi_results, ManyEcoEvo) summarise_conclusions <- function(ManyEcoEvo_results, ManyEcoEvo_yi_results, ManyEcoEvo) { effect_ids <- ManyEcoEvo_results %>% @@ -127,13 +117,11 @@ summarise_conclusions <- function(ManyEcoEvo_results, ManyEcoEvo_yi_results, Man #' #' @return A dataframe with counts `n` for each unique value of `Conclusion` for each `dataset` #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr group_by -#' @importFrom dplyr count -#' @importFrom magrittr "%>%" +#' @import dplyr #' @author Hannah S. Fraser #' @author Elliot Gould #' @examples +#' data(ManyEcoEvo) #' ManyEcoEvo$data[[1]] %>% #' filter(Conclusion != "CHECK") %>% #' summarise_conclusions_data() diff --git a/R/summarise_model_composition.R b/R/summarise_model_composition.R index e3f137a..cdd0b8c 100644 --- a/R/summarise_model_composition.R +++ b/R/summarise_model_composition.R @@ -12,19 +12,9 @@ #' #' @return A dataframe #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr select -#' @importFrom tidyr unnest -#' @importFrom dplyr mutate -#' @importFrom dplyr rename -#' @importFrom dplyr group_by -#' @importFrom dplyr distinct -#' @importFrom magrittr "%>%" -#' @importFrom dplyr right_join -#' @importFrom dplyr across -#' @importFrom tidyr pivot_longer -#' @importFrom purrr map_dfr -#' @importFrom purrr set_names +#' @import dplyr +#' @import tidyr +#' @import purrr #' @author Hannah S. Fraser #' @author Elliot Gould #' @family Multi-dataset Wrapper Functions diff --git a/R/summarise_review_data.R b/R/summarise_review_data.R index fa4205b..18859bf 100644 --- a/R/summarise_review_data.R +++ b/R/summarise_review_data.R @@ -8,25 +8,19 @@ #' #' @return A named list of length two of `summarised_data_analyses` containing a tibble of summary statistics for each outcome `subset` (`effects` or `predictions`) generated by [summarise_analyses_by_reviewer()], and `summarised_data_reviews` containing a tibble of sumary statistics for each outcome `subset`, for each `dataset` generated by [summarise_reviews_per_analysis()]. #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr select -#' @importFrom tidyr unnest -#' @importFrom dplyr mutate -#' @importFrom dplyr rename -#' @importFrom dplyr group_by -#' @importFrom dplyr distinct -#' @importFrom magrittr "%>%" -#' @importFrom dplyr right_join -#' @importFrom purrr map_dfr -#' @importFrom purrr set_names -#' @importFrom dplyr ends_with -#' @importFrom broom tidy +#' @import dplyr +#' @import tidyr +#' @import purrr +#' @import broom #' @import metafor #' @author Hannah S. Fraser #' @author Elliot Gould #' @family Multi-dataset Wrapper Functions #' #' @examples +#' data(ManyEcoEvo) +#' data(ManyEcoEvo_results) +#' data(ManyEcoEvo_yi_results) #' summarise_reviews(ManyEcoEvo, ManyEcoEvo_results, ManyEcoEvo_yi_results) summarise_reviews <- function(ManyEcoEvo, ManyEcoEvo_results, ManyEcoEvo_yi_results) { review_data <- @@ -119,12 +113,10 @@ summarise_reviews <- function(ManyEcoEvo, ManyEcoEvo_results, ManyEcoEvo_yi_resu #' #' @return A dataframe summarising the `mean`, `sd`, `min`, and `max` of the number of reviews provided by each unique reviewer across *all* analyses from all `dataset`s in `review_data`. #' @export -#' @importFrom dplyr group_by -#' @importFrom dplyr summarise -#' @importFrom dplyr n_distinct -#' @importFrom magrittr "%>%" +#' @import dplyr #' #' @examples +#' data(ManyEcoEvo) #' ManyEcoEvo %>% #' ungroup() %>% #' select(data, -dataset) %>% @@ -151,12 +143,10 @@ summarise_analyses_by_reviewer <- function(review_data) { #' #' @return A dataframe with the variables `dataset`, and the `mean`, `sd`, `min`, `max` of the number of times each analysis was reviewed #' @export -#' @importFrom dplyr group_by -#' @importFrom dplyr summarise -#' @importFrom dplyr n_distinct -#' @importFrom magrittr "%>%" +#' @import dplyr #' #' @examples +#' data(ManyEcoEvo) #' ManyEcoEvo %>% #' ungroup() %>% #' select(data, -dataset) %>% diff --git a/R/summarise_sorensen_index.R b/R/summarise_sorensen_index.R index 887022c..733d66c 100644 --- a/R/summarise_sorensen_index.R +++ b/R/summarise_sorensen_index.R @@ -9,19 +9,9 @@ #' #' @return A tibble of aggregate summary statistics (`mean`, `sd`, `min`, `max`) for mean Sorensen's index estimates across each `subset` and `dataset`. #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr select -#' @importFrom tidyr unnest -#' @importFrom dplyr mutate -#' @importFrom dplyr rename -#' @importFrom dplyr group_by -#' @importFrom dplyr distinct -#' @importFrom magrittr "%>%" -#' @importFrom dplyr right_join -#' @importFrom dplyr across -#' @importFrom tidyr pivot_longer -#' @importFrom purrr map_dfr -#' @importFrom purrr set_names +#' @import dplyr +#' @import tidyr +#' @import purrr #' @author Hannah S. Fraser #' @author Elliot Gould #' @family Multi-dataset Wrapper Functions diff --git a/R/summarise_variable_counts.R b/R/summarise_variable_counts.R index 2cd7bd6..1bb6b26 100644 --- a/R/summarise_variable_counts.R +++ b/R/summarise_variable_counts.R @@ -12,21 +12,10 @@ #' #' @return A dataframe of count values `n` or summary statistic values `n_mean`,`n_sd`,`n_min`,`n_max` of counts depending on the the value supplied to the `output` argument. #' @export -#' @importFrom dplyr filter -#' @importFrom dplyr select -#' @importFrom tidyr unnest -#' @importFrom dplyr mutate -#' @importFrom dplyr rename -#' @importFrom dplyr group_by -#' @importFrom dplyr distinct -#' @importFrom magrittr "%>%" -#' @importFrom dplyr right_join -#' @importFrom dplyr across -#' @importFrom tidyr pivot_longer -#' @importFrom purrr map_dfr -#' @importFrom purrr set_names -#' @importFrom dplyr ends_with -#' @importFrom broom tidy +#' @import dplyr +#' @import tidyr +#' @import purrr +#' @import broom #' @author Hannah S. Fraser #' @author Elliot Gould #' @family Multi-dataset Wrapper Functions @@ -125,13 +114,8 @@ summarise_variable_counts <- function(ManyEcoEvo, ManyEcoEvo_results, ManyEcoEvo #' 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`). #' @return A dataframe of counts `n` each `variable` is used across all analyses within a given `dataset` #' @export -#' @importFrom dplyr group_by -#' @importFrom dplyr mutate -#' @importFrom dplyr across -#' @importFrom dplyr everything -#' @importFrom magrittr "%>%" -#' @importFrom tidyr pivot_longer -#' @importFrom dplyr summarise +#' @import dplyr +#' @import tidyr #' @author Hannah S. Fraser #' @author Elliot Gould #' @examples