Skip to content

Commit

Permalink
#102 #97 replace @importFrom calls with @import
Browse files Browse the repository at this point in the history
  • Loading branch information
egouldo committed Aug 12, 2024
1 parent 6b4e53f commit 22cca8b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 112 deletions.
28 changes: 6 additions & 22 deletions R/summarise_analysis_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
30 changes: 9 additions & 21 deletions R/summarise_conclusions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>%
Expand Down Expand Up @@ -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()
Expand Down
16 changes: 3 additions & 13 deletions R/summarise_model_composition.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 11 additions & 21 deletions R/summarise_review_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 <-
Expand Down Expand Up @@ -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) %>%
Expand All @@ -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) %>%
Expand Down
16 changes: 3 additions & 13 deletions R/summarise_sorensen_index.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 6 additions & 22 deletions R/summarise_variable_counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 22cca8b

Please sign in to comment.