Skip to content

Commit 819f6dc

Browse files
committed
fix bugs for testing
1 parent 89bf782 commit 819f6dc

17 files changed

+51
-8
lines changed

.github/workflows/R-CMD-check.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ jobs:
4747
"graphics",
4848
"utils",
4949
"colorspace",
50-
"png",
51-
"ggpubr",
52-
"devtools"
50+
"png"
5351
))
5452
remotes::install_deps(dependencies = TRUE)
5553
shell: Rscript {0}

R/create_plots.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#' @import ggplot2
66
#' @importFrom ggplot2 element_text
77
#' @param plot_data_list A list of lists containing effect size data for plotting:
8-
#' - plot_data_list[i] = `plot_data`: contains:
8+
#' - plot_data_list = `plot_data`: contains:
99
#' - `data`: A list containing sorted & downsampled effect size data & helpers: estimate, cons_estimate, lb, ub, below_cross_idx, and above_cross_idx
1010
#' - `extra_study_details`: A list containing extra descriptive info: percent_not_zero, max_cons_effect, group_by_title, n_title, mv_estimate, and mv_ci
1111
#' - `study_details`: A list of original study details: orig_stat_type, test_component_1, test_component_2, dataset, map_type, group, and ref
@@ -21,7 +21,9 @@
2121
#'
2222
#' @examples
2323
#' # Example usage
24+
#' \dontrun{
2425
#' create_plots(pd)
26+
#' }
2527
create_plots <- function(plot_data_list, plot_type = 'simci', effect_type = 'd', do_multivariate = FALSE, add_description = FALSE, do_minimal_title = FALSE, summary_info = NULL) {
2628

2729
# General plot parameters

R/meta_analysis.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#'
1515
#' @examples
1616
#' # Example usage
17+
#' \dontrun{
1718
#' meta_analysis(v,v$brain_masks, "pooling.none.motion.none.mv.none")
19+
#' }
1820
meta_analysis <- function(v, brain_masks, combo_name, grouping_var = "category") {
1921

2022
testing <- FALSE

R/plot_helpers.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
#'
4343
#' @examples
4444
#' # Example usage
45+
#' \dontrun{
4546
#' plot_simci_panel(plot_data)
47+
#' }
4648
plot_simci_panel <- function(pp, plot_data_list) {
4749

4850
if (length(plot_data_list) == 0) {
@@ -130,13 +132,16 @@ plot_simci_panel <- function(pp, plot_data_list) {
130132
#' - `summary_info`: A list containing extra descriptive info: percent_not_zero, max_cons_effect, group_by_title, and n_title
131133
#' - `mv_data`: A list containing multivariate effect size data: estimate, lb, and ub
132134
#' - `study_details`: A list of original study details: orig_stat_type, test_component_1, test_component_2, dataset, map_type, group, and ref
135+
#' @param use_effect_size_bin Whether to bin effect sizes
133136
#'
134137
#' @return A ggplot object containing one or overlapping densities
135138
#' @export
136139
#'
137140
#' @examples
138141
#' # Example usage
142+
#' \dontrun{
139143
#' plot_density_panel(plot_data)
144+
#' }
140145
plot_density_panel <- function(pp, plot_data_list, use_effect_size_bin = FALSE) {
141146

142147
# add density-specific plot params
@@ -306,7 +311,9 @@ plot_density_panel <- function(pp, plot_data_list, use_effect_size_bin = FALSE)
306311
#'
307312
#' @examples
308313
#' # Example usage
314+
#' \dontrun{
309315
#' plot_activation_maps(plot_data)
316+
#' }
310317
plot_activation_panel <- function(pp, plot_data_list, threshold_category = NA) {
311318

312319
# add spatial map-specific plot params
@@ -552,7 +559,9 @@ colorbar_custom <- function(breaks, #the minimum and maximum z values for which
552559
#'
553560
#' @examples
554561
#' # Example usage
562+
#' \dontrun{
555563
#' plot_connectivity_panel(plot_data)
564+
#' }
556565
plot_connectivity_panel <- function(pp, plot_data_list, threshold_category = NA) {
557566

558567
# add connectivity map-specific plot params
@@ -1018,7 +1027,9 @@ plot_power_panel <- function(pp, plot_data_list, output_type, use_category_bins
10181027
#'
10191028
#' @examples
10201029
#' # Example usage
1030+
#' \dontrun{
10211031
#' get_summary_info(pp, study_details, extra_study_details)
1032+
#' }
10221033
get_summary_info <- function(study_details, extra_study_details) {
10231034

10241035
summary_info <- list()
@@ -1122,7 +1133,9 @@ combine_summary_info <- function(summary_info) {
11221133
#'
11231134
#' @examples
11241135
#' # Example usage
1136+
#' \dontrun{
11251137
#' add_plot_description(p, pp, study_details, extra_study_details)
1138+
#' }
11261139
add_plot_description <- function(p, pp, summary_info, add_extra_text, do_minimal_title) {
11271140

11281141
# add description-specific plot params

R/prep_data_for_plot.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
#'
1717
#' @examples
1818
#' # Example usage
19+
#' \dontrun{
1920
#' plot_info <- list(grouping_var = 'none', group_level = 'test', ref = 'atlas')
2021
#' pd <- prep_data_for_plot(data = v$data[[i]], study_details = v$study[i, ],
2122
#' plot_info = plot_info, grouping_var='none',
2223
#' combo_name = "pooling.none.motion.none.mv.none",
2324
#' mv_combo_name = "pooling.none.motion.none.mv.multi")
25+
#' }
2426
prep_data_for_plot <- function(data, study_details, combo_name, mv_combo_name, estimate = 'd', plot_info = 'NA', prep_spatial = FALSE, brain_masks = NA) {
2527

2628

R/prep_data_for_spatial_plot.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#'
1717
#' @examples
1818
#' # Example usage
19+
#' \dontrun{
1920
#' pd <- prep_data_for_spatial_plot(data = v$data[[i]],
20-
#' study_details = v$study[i, ], plot_info$grouping_var='none',
21+
#' brain_masks = brain_masks,
22+
#' study_details = v$study[i, ],
2123
#' combo_name = "pooling.none.motion.none.mv.none",
2224
#' mv_combo_name = "pooling.none.motion.none.mv.multi")
25+
#' }
2326
prep_data_for_spatial_plot <- function(data, brain_masks, study_details, combo_name, mv_combo_name, estimate = 'd', plot_info = 'NA') {
2427

2528
# Input validation

demo/00Index

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
main_figure_generator generates figures for BrainEffeX using utils package
1+
main_figure_generator Example demonstration of package functions

man/add_plot_description.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/create_plots.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_summary_info.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)