Skip to content

Commit

Permalink
Fix that shinyapps.io does not find shared_shiny_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasWallrich committed Nov 14, 2024
1 parent 9ccd88a commit e2e264d
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inst/fred_annotator/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ df$ref_original <- gsub("(.{70,}?)\\s", "\\1\n", df$ref_original) # line breaks

source("website_text.R", local = TRUE) # Evaluate in calling environment, otherwise fails on app start

source("../shared_shiny_resources/replication_outcome_styles.R", local = TRUE) # Evaluate in calling environment, otherwise fails on app start
source("replication_outcome_styles.R", local = TRUE) # Evaluate in calling environment, otherwise fails on app start

## Add custom theme (formatting)
custom_css <- ("
Expand Down
48 changes: 48 additions & 0 deletions inst/fred_annotator/replication_outcome_styles.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
success_criteria_colors <- tibble::tribble(
~criterion, ~label, ~color,

# significance_r outcome_report labels
"significance_r", "OS not significant", "#D3D3D3",
"significance_r", "failure", "#FF7F7F",
"significance_r", "success", "#8FBC8F",
"significance_r", "failure (reversal)", "darkred",

# significance_agg outcome_report labels
"significance_agg", "success", "#8FBC8F",
"significance_agg", "failure", "#FF7F7F",
"significance_agg", "failure (reversal)", "darkred",

# consistency_ci outcome_report labels
"consistency_ci", "success", "#8FBC8F",
"consistency_ci", "failure", "#FF7F7F",

# consistency_pi outcome_report labels
"consistency_pi", "success", "#8FBC8F",
"consistency_pi", "failure", "#FF7F7F",

# homogeneity outcome_report labels
"homogeneity", "success", "#8FBC8F",
"homogeneity", "failure", "#FF7F7F",

# homogeneity_significance outcome_report labels
"homogeneity_significance", "OS not significant", "#D3D3D3",
"homogeneity_significance", "success (homogeneous and jointly significantly above 0)", "#8FBC8F",
"homogeneity_significance", "failure (not homogeneous but jointly significantly above 0)", "#FF7F7F",
"homogeneity_significance", "failure (effects are not homogeneous and not significant)", "#FF7F7F",
"homogeneity_significance", "failure (homogeneous but not significant)", "#FF7F7F",
"homogeneity_significance", "failure (not homogeneous and not significant)", "#FF7F7F",

# small_telescopes outcome_report labels
"small_telescopes", "success", "#8FBC8F",
"small_telescopes", "failure", "#FF7F7F"
)

success_criterion_note <- c(
significance_r = "Replication success was assessed based on the statistical significance of the replication effect (and whether its direction is consistent with the original effect). Replications that were significant and in the same direction as the original were considered as successes, while replications that were not significant or in the opposite direction were considered as failures.",
significance_agg = "Replication success was assessed based on the aggregation of effect sizes from the original and replication studies using a meta-analytic approach. Replications where the combined effect was significantly different from zero were considered as successes, while those where the combined effect was not significant were considered as failures.",
consistency_ci = "Replication success was assessed based on whether the original effect size fell within the confidence interval of the replication effect size. Replications where the original effect size was within the confidence interval were considered as successes, while those where it was outside were considered as failures.",
consistency_pi = "Replication success was assessed based on whether the replication effect size fell within the prediction interval derived from the original study and replication sample size. Replications within the prediction interval were considered as successes, while those outside the prediction interval were considered as failures.",
homogeneity = "Replication success was assessed based on the homogeneity of the effects from the original and replication studies using a heterogeneity test (Q-test). Replications where the effects were homogeneous were considered as successes, while those that showed heterogeneity were considered as failures.",
homogeneity_significance = "Replication success was assessed based on the combination of homogeneity and the significance of the effect sizes. Replications where the effects were homogeneous and jointly significantly different from zero were considered as successes, while those that were either not homogeneous or not significantly different from zero were considered as failures.",
small_telescopes = "Replication success was assessed based on whether the replication effect size was larger than the effect size that would have given the original study a power of 33%. Replications that met this criterion were considered as successes, while those that did not were considered as failures."
)
2 changes: 1 addition & 1 deletion inst/fred_explorer/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ forestplotheight <- "28000px"
# WEBSITE TEXT --------------------------------------------------------------

source("website_text.R", local = TRUE) # Evaluate in calling environment, otherwise fails on app start
source("../shared_shiny_resources/replication_outcome_styles.R", local = TRUE) # Evaluate in calling environment, otherwise fails on app start
source("replication_outcome_styles.R", local = TRUE) # Evaluate in calling environment, otherwise fails on app start


## Add custom theme (formatting)
Expand Down
48 changes: 48 additions & 0 deletions inst/fred_explorer/replication_outcome_styles.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
success_criteria_colors <- tibble::tribble(
~criterion, ~label, ~color,

# significance_r outcome_report labels
"significance_r", "OS not significant", "#D3D3D3",
"significance_r", "failure", "#FF7F7F",
"significance_r", "success", "#8FBC8F",
"significance_r", "failure (reversal)", "darkred",

# significance_agg outcome_report labels
"significance_agg", "success", "#8FBC8F",
"significance_agg", "failure", "#FF7F7F",
"significance_agg", "failure (reversal)", "darkred",

# consistency_ci outcome_report labels
"consistency_ci", "success", "#8FBC8F",
"consistency_ci", "failure", "#FF7F7F",

# consistency_pi outcome_report labels
"consistency_pi", "success", "#8FBC8F",
"consistency_pi", "failure", "#FF7F7F",

# homogeneity outcome_report labels
"homogeneity", "success", "#8FBC8F",
"homogeneity", "failure", "#FF7F7F",

# homogeneity_significance outcome_report labels
"homogeneity_significance", "OS not significant", "#D3D3D3",
"homogeneity_significance", "success (homogeneous and jointly significantly above 0)", "#8FBC8F",
"homogeneity_significance", "failure (not homogeneous but jointly significantly above 0)", "#FF7F7F",
"homogeneity_significance", "failure (effects are not homogeneous and not significant)", "#FF7F7F",
"homogeneity_significance", "failure (homogeneous but not significant)", "#FF7F7F",
"homogeneity_significance", "failure (not homogeneous and not significant)", "#FF7F7F",

# small_telescopes outcome_report labels
"small_telescopes", "success", "#8FBC8F",
"small_telescopes", "failure", "#FF7F7F"
)

success_criterion_note <- c(
significance_r = "Replication success was assessed based on the statistical significance of the replication effect (and whether its direction is consistent with the original effect). Replications that were significant and in the same direction as the original were considered as successes, while replications that were not significant or in the opposite direction were considered as failures.",
significance_agg = "Replication success was assessed based on the aggregation of effect sizes from the original and replication studies using a meta-analytic approach. Replications where the combined effect was significantly different from zero were considered as successes, while those where the combined effect was not significant were considered as failures.",
consistency_ci = "Replication success was assessed based on whether the original effect size fell within the confidence interval of the replication effect size. Replications where the original effect size was within the confidence interval were considered as successes, while those where it was outside were considered as failures.",
consistency_pi = "Replication success was assessed based on whether the replication effect size fell within the prediction interval derived from the original study and replication sample size. Replications within the prediction interval were considered as successes, while those outside the prediction interval were considered as failures.",
homogeneity = "Replication success was assessed based on the homogeneity of the effects from the original and replication studies using a heterogeneity test (Q-test). Replications where the effects were homogeneous were considered as successes, while those that showed heterogeneity were considered as failures.",
homogeneity_significance = "Replication success was assessed based on the combination of homogeneity and the significance of the effect sizes. Replications where the effects were homogeneous and jointly significantly different from zero were considered as successes, while those that were either not homogeneous or not significantly different from zero were considered as failures.",
small_telescopes = "Replication success was assessed based on whether the replication effect size was larger than the effect size that would have given the original study a power of 33%. Replications that met this criterion were considered as successes, while those that did not were considered as failures."
)

0 comments on commit e2e264d

Please sign in to comment.