Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

Commit 34007ec

Browse files
authored
Update r_functionality.R
1 parent 8fcdd1a commit 34007ec

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

r_functionality.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,13 @@ ggbetweenstatsWithPriorNormalityCheckAsterisk <- function(data, x, y, ylab, xlab
615615
dplyr::mutate(asterisk_label = ifelse(`p.value` < 0.05 & `p.value` > 0.01, "*", ifelse(`p.value` < 0.01 & `p.value` > 0.001, "**", ifelse(`p.value` < 0.001, "***", NA)))))
616616

617617
df <- df %>% dplyr::filter(!is.na(asterisk_label))
618-
619-
#y_positions_asterisks <- car::recode(df$asterisk_label, "NA=0.0; else=7.50") #
620-
# adjust to maximum value in the dataset
618+
619+
620+
# adjust to the maximum value in the dataset
621621
lowestNumberText <- paste0("NA=0.0; else=", toString(round((max(data[[y]]) + 0.5), digits = 2)))
622-
y_positions_asterisks <- recode(df$asterisk_label, recodes = lowestNumberText)
622+
# Explicitly call car::recode to avoid conflicts with dplyr::recode
623+
# WRAP result in as.numeric() to fix the binary operator error
624+
y_positions_asterisks <- as.numeric(car::recode(df$asterisk_label, recodes = lowestNumberText))
623625

624626

625627
count <- 0
@@ -2767,3 +2769,4 @@ geom_signif_wrapper <- function(...) ggsignif::geom_signif(...)
27672769
shapiro_test_wrapper <- function(...) stats::shapiro.test(...)
27682770
extract_stats_wrapper <- function(...) ggstatsplot::extract_stats(...)
27692771

2772+

0 commit comments

Comments
 (0)