diff --git a/boxplot_examples.R b/boxplot_examples.R
index dbeca218af4b4562bcb89d01741d53a57e58a31f..6ec58e539ccff40f2fd1c4affed93283ad858e16 100644
--- a/boxplot_examples.R
+++ b/boxplot_examples.R
@@ -1,171 +1,187 @@
 # EXAMPLES
-### nice representation (1)
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), categ.class.order = list(NULL, c("B", "A")), box.legend.name = "LEGEND", categ.color = NULL, box.width = 0.3, box.whisker.width = 0.8, dot.color = "same", dot.jitter = 0.5, dot.size = 3.5, dot.border.size = 0.2, dot.alpha = 0.5, y.lim = c(10, 25), y.include.zero = TRUE, stat.disp = "above", stat.size = 4, x.lab = "GROUP", y.lab = "VALUE", text.size = 12, title = "GRAPH1", title.text.size = 8, text.angle = 0, article = TRUE, grid = TRUE)
-### nice representation (2)
-set.seed(1)
-obs1 <- data.frame(Time = c(rnorm(24, 0), rnorm(24, -10), rnorm(24, 10), rnorm(24, 20)), Group1 = rep(c("CAT", "DOG"), times = 48), Group2 = rep(c("A", "B", "C", "D"), each = 24))
-set.seed(NULL)
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), categ.class.order = list(NULL, c("B", "A", "D", "C")), box.legend.name = "LEGEND", categ.color = NULL, box.width = 0.8, dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 60, dot.size = 3.5, dot.border.size = 0.2, dot.alpha = 0.5, y.lim= c(-20, 30), stat.disp = "above", stat.size = 4, stat.dist = 1, x.lab = "GROUP", y.lab = "VALUE", vertical = FALSE, text.size = 12, title = "GRAPH1", title.text.size = 8, text.angle = 45, article = FALSE)
-### separate boxes. Simple example
-set.seed(1)
-obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10))
-set.seed(NULL)
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1")
-### separate boxes. Changing the order of the boxes
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", categ.class.order = list(c("H", "G")))
-### separate boxs. Example (1) of modification of box color using a single value
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", categ.color = "white")
-### separate boxs. Example (2) of modification of box color using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", categ.color = c("coral", "lightblue"))
-### separate boxs. Example (3) of modification of box color using the box.color data frame column, with respect of the correspondence between categ2 and box.color columns
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), box.color = rep(c("coral", "lightblue"), time = 10))
-obs1
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", categ.color = obs1$box.color)
-### separate boxs. Example (1) of modification of dot color, using the same dot color as the corresponding box
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", dot.color = "same")
-### separate boxs. Example (2) of modification of dot color, using a single color for all the dots
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", dot.color = "green")
-### separate boxs. Example (3) of modification of dot color, using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", dot.color = c("green", "brown"))
-### separate boxs. Example (4) of modification of dot color, using different colors for each dot
-obs1 <- data.frame(Time = 1:10, Group1 = rep(c("G", "H"), times = 5))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", dot.color = hsv(h = (1:nrow(obs1)) / nrow(obs1)))
-### grouped boxs. Simple example
+
+### Data set
 set.seed(1)
-obs1 <- data.frame(Time = c(rnorm(20), rnorm(20) + 2), Group1 = rep(c("G", "H"), each = 10), Group2 = rep(c("A", "B"), time = 10))
+obs1 <- data.frame(
+    Time = c(rnorm(20, 100, 10), rnorm(20, 200, 50), rnorm(20, 500, 60), rnorm(20, 100, 50)), 
+    Categ1 = rep(c("CAT", "DOG"), times = 40), 
+    Categ2 = rep(c("A", "B", "C", "D"), each = 20), 
+    Color1 = rep(c("coral", "lightblue"), times = 40), 
+    Color2 = rep(c("#9F2108", "#306100", "#007479", "#8500C0"), each = 20)
+)
 set.seed(NULL)
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"))
-### grouped boxs. More grouped boxs
-obs1 <- data.frame(Time = 1:24, Group1 = rep(c("G", "H"), times = 12), Group2 = rep(c("A", "B", "C", "D"), each = 6))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"))
-### grouped boxs. Example (1) of modification of box color, using a single value
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), categ.color = "white")
-### grouped boxs. Example (2) of modification of box color, using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), categ.color = c("coral", "lightblue"))
-### grouped boxs. Example (3) of modification of box color, using one value per line of obs1, with respect of the correspondence between categ2 and box.color columns
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10), box.color = rep(c("coral", "lightblue"), each = 10))
-obs1
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), categ.color = obs1$box.color)
-### grouped boxs. Example (1) of modification of dot color, using the same dot color as the corresponding box
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "same")
-### grouped boxs. Example (2) of modification of dot color, using a single color for all the dots
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "green")
-### grouped boxs. Example (3) of modification of dot color, using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = c("green", "brown"))
-### grouped boxs. Example (4) of modification of dot color, using different colors for each dot
-obs1 <- data.frame(Time = 1:10, Group1 = rep(c("G", "H"), times = 5), Group2 = rep(c("A", "B"), each = 5))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = hsv(h = (1:nrow(obs1)) / nrow(obs1)))
-### no dots (y.include.zero set to TRUE to see the lowest box):
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = NULL, y.include.zero = TRUE)
-### box width. Example (1) with box.width = 0.25 -> three times more space between single boxs than the box width (y.include.zero set to TRUE to see the lowest box)
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), each = 500))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", dot.color = NULL, y.include.zero = TRUE, box.width = 0.25)
-### box width. Example (2) with box.width = 1, no space between single boxs
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), each = 500))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", dot.color = NULL, y.include.zero = TRUE, box.width = 1)
-### box width. Example (3) with box.width = 0.25 -> three times more space between sets of grouped boxs than the set width
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = NULL, y.include.zero = TRUE, box.width = 0.25)
-### box width. Example (4) with box.width = 0 -> no space between sets of grouped boxs
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = NULL, y.include.zero = TRUE, box.width = 1)
-### whisker width. Example (1) with box.whisker.width = 1 -> whiskers have the width of the corresponding box
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = NULL, box.whisker.width = 1)
-### whisker width. Example (2) error boxs with no whiskers
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = NULL, box.whisker.width = 0)
-### tidy dot distribution. Example (1)
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 100)
-### tidy dot distribution. Example (2) reducing the dot size with dot.tidy.bin.nb
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 150)
-### dot jitter. Example (1)
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "same", dot.tidy = FALSE, dot.jitter = 1, dot.size = 2) 
-### dot jitter. Example (2) with dot.jitter = 1 -> dispersion around the corresponding box width
-obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "grey", dot.size = 3, dot.alpha = 1,  dot.jitter = 1)
-### dot jitter. Example (3) with no dispersion
-obs1 <- data.frame(Time = 1:100, Group1 = rep(c("G", "H"), times = 50), Group2 = rep(LETTERS[1:5], each = 20))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "grey", dot.size = 3, dot.alpha = 1,  dot.jitter = 0)
-### dot size, dot border size and dot transparency
-obs1 <- data.frame(Time = 1:100, Group1 = rep(c("G", "H"), times = 50), Group2 = rep(LETTERS[1:5], each = 20))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "grey", dot.size = 4, dot.border.size = 0, dot.alpha = 0.6)
-### y-axis limits. Example (1)
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.lim = c(-1, 25))
-### y-axis limits. Example (2) showing that order matters in y.lim argument
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.lim = c(25, -1))
-### log scale. Example (1). BEWARE: y column must be log, otherwise incoherent scale (see below warning message with the return argument)
-obs1 <- data.frame(Time = c((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10")
-### log scale. Example (2). BEWARE: values of the y.lim must be in the corresponding log
-obs1 <- data.frame(Time = c((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10", y.lim = c(100,1000))
-### tick number. Example (1)
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.tick.nb = 10)
-### tick number. Example (2) using a log2 scale
-obs1 <- data.frame(Time = log2((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log2", y.tick.nb = 10, y.lim = c(1, 16))
-### tick number. Example (3) using a log10 scale
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10", y.tick.nb = 10)
-### tick number. Example (4) using a log10 scale: the reverse y-axis correctly deal with log10 scale
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10", y.tick.nb = 10, y.lim = c(4, 1))
-### secondary tick number. Example (1)
-obs1 <- data.frame(Time = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.second.tick.nb = 2)
-### secondary ticks. Example (2) not for log2 and log10 scales (see below warning message with the return argument)
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10", y.second.tick.nb = 2)
-### include zero in the y-axis
-obs1 <- data.frame(Time = (1:20), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.include.zero = TRUE)
-### extra margins. To avoid dot cuts
-obs1 <- data.frame(Time = (1:20), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.top.extra.margin = 0.25, y.bottom.extra.margin = 0.25)
-### mean diplay. Example (1) at the top of the plot region
-obs1 <- data.frame(Time = (1:20), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.top.extra.margin = 0.1, stat.disp = "top", stat.size = 4, stat.dist = 2)
-### mean diplay. Example (2) above boxs
-obs1 <- data.frame(Time = (1:20), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.top.extra.margin = 0.1, stat.disp = "above", stat.size = 4, stat.dist = 2)
-### box orientation.  Example (1) without log scale, showing that the other arguments are still operational
-obs1 <- data.frame(Time = (1:20), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.tick.nb = 10, y.second.tick.nb = 2, y.include.zero = TRUE, vertical = FALSE)
-### box orientation. Example (2) with log scale. Horizontal orientation is blocked with log2 and log10 scales because of a bug in ggplot2 (https://github.com/tidyverse/ggplot2/issues/881)
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10", vertical = FALSE)
-### classic representation (use grid = TRUE to display the background lines of the y axis ticks)
-obs1 <- data.frame(Time = (1:20), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), article = TRUE, grid = FALSE)
-### graphic info. Example (1)
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), return = TRUE)
-### graphic info. Example (2) of assignation and warning message display
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-warn <- fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), y.log = "log10", return = TRUE)
-cat(warn$warnings)
-### add ggplot2 functions
-obs1 <- data.frame(Time = log10((1:20) * 100), Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), add = "+ggplot2::theme_classic()")
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1", article = FALSE, add = "+ggplot2::facet_wrap(facets = 'Group2', labeller = 'label_both') + ggplot2::theme(strip.background = ggplot2::element_rect(color = 'grey', size = 0.5), strip.text = ggplot2::element_text(size = 10, face = 'bold'), panel.spacing = ggplot2::unit(0.5, 'lines'))")  # or ggplot2::vars(Group2) instead of 'Group2'. See https://ggplot2.tidyverse.org/reference/labeller.html
+fun_info(obs1)
+
+## Mandatory arguments
+### separate boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1")
+### grouped boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"))
+# Order matters
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ2", "Categ1"))
+### single class
+fun_gg_boxplot(data1 = obs1[1:20, ], y = "Time", categ = "Categ2")
+fun_gg_boxplot(data1 = obs1[1:20, ], y = "Time", categ = c("Categ1", "Categ2"))
+
+### Changing the order of the boxes
+# separate boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.class.order = list(c("DOG", "CAT")))
+# grouped boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.class.order = list(c("DOG", "CAT"), c("D", "C", "B", "A")))
+
+### Box color
+# Using a single color value
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = "coral")
+# Using one color value par class of Categ1
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = c("coral", "lightblue"))
+# Using a vector of color values (e.g., data frame column), with respect of the correspondence between Categ1 and box.color columns
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = obs1$Color1)
+# Using integers instead of color strings
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = 1)
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = 1:2)
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = as.numeric(obs1$Color1))
+# With grouped boxes, we generate the same effects but for the second category
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.color = "coral")
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.color = 1:4)
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.color = obs1$Color2)
+
+### Other parameters of boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+box.legend.name = "ANIMALS", 
+box.fill = TRUE, 
+box.width = 0.6, # separate boxes: between 0 (no box width <-> max boxes separation) and 1 (max box width <-> no boxes separation). Grouped boxes: between 0 (no group width <-> max group separation) and 1 (max group width <-> no group separation)
+box.space = 0, # between 0 (no separation) and 1 (max separation) but only to separate boxes inside groups of boxes
+box.line.size = 0.75, 
+box.notch = TRUE, 
+box.alpha = 1, 
+box.mean = FALSE, 
+box.whisker.kind = "max", 
+box.whisker.width = 0.5 # between 0 (no whisker extremities) and 1 (whisker extremities the width of the boxes)
+)
+
+### Dot colors
+# Dot removal
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = NULL)
+# Same color as the boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = "same")
+# Single color sting
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = "green") # a single integer also works
+# Same number of Categ1 classes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = c("green", "brown")) # test also 1:2 (result is idem as "same")
+# Using a vector of color values of the same length as the number of rows in data1 (e.g., data frame column). No correspondence with Categ1 classes is required
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = 1:nrow(obs1))
+# With grouped boxes, we generate the same effects but for the second category
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = NULL)
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "same")
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "green") # a single integer also works
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = c("green", "brown", "red", "blue")) # test also 1:2 (result is idem as "same")
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = 1:nrow(obs1))
+
+### Legend for dots
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+dot.color = c("green", "brown", "red", "blue"), # single color or same number of dot.categ classes in that case ("same" authorized if dot.categ is the last element of categ)
+dot.categ = "Categ2", 
+dot.categ.class.order = c("D", "A", "C", "B"), 
+dot.legend.name = "ANIMAL GROUP"
+)
+
+### Tidy or random dot spreading
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+dot.tidy = TRUE, 
+dot.tidy.bin.nb = 50, # from 0 to Inf. Only if dot.tidy = TRUE
+dot.jitter = 0.5 # from 0 to 1. Only if dot.tidy = FALSE
+)
+
+### Other parameters of dots
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+dot.categ = "Categ2", # to see the dot legend
+dot.color = c("green", "brown", "red", "blue"), 
+dot.size = 5, # ignored if dot.tidy = TRUE
+dot.alpha = 0.3, 
+dot.border.size = 2, 
+dot.border.color = "green", 
+)
+
+### X-axis parameter
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+x.lab = "ANIMALS" 
+)
+
+### Y-axis parameter
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+y.lab = "SIZE", 
+y.lim = c(1000, 0.1), # order matters
+y.log = "log10", # try "no"
+y.tick.nb = 10, # approximate number
+y.second.tick.nb = 2, 
+y.include.zero = FALSE, 
+y.top.extra.margin = 0, 
+y.bottom.extra.margin = 0, 
+)
+
+### Stat numbers above boxes
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+stat.disp = "above", # try "top"
+stat.disp.mean = FALSE, 
+stat.size = 4, 
+stat.dist = 2
+)
+
+### Plot orientation
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+vertical = FALSE # with log2 and log10 scales, horizontal orientation is blocked because of a bug in ggplot2 (https://github.com/tidyverse/ggplot2/issues/881)
+)
+
+
+### Text management
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+text.size = 20, 
+text.angle = 90
+)
+
+### Title
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+title = "FIRST EXPERIMENT", 
+title.text.size = 20
+)
+
+### Management of the legend area
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+legend.show = FALSE, # remove the legend, not the area of the legend
+legend.width = 1 # between 0 (no area for the legend) to 1 (half the device width for the legend area). Use NULL for default management
+)
+
+### Appearance
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+article = FALSE, 
+grid = TRUE
+)
+
+### the add argument
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+add = "+ggplot2::theme_classic()"
+)
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+add = "+ggplot2::facet_wrap(facets = 'Categ2', labeller = 'label_both') + ggplot2::theme(strip.background = ggplot2::element_rect(color = 'grey', size = 0.5), strip.text = ggplot2::element_text(size = 10, face = 'bold'), panel.spacing = ggplot2::unit(0.5, 'lines'))"  # or ggplot2::vars(Categ2) instead of 'Categ2'. See https://ggplot2.tidyverse.org/reference/labeller.html
+)
+
+
+### Other parameters
+fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", 
+return = TRUE, 
+return.ggplot = TRUE,
+plot = FALSE, 
+warn.print = FALSE, 
+lib.path = NULL
+)
+
+
+
+
+
+
+
+
+
 
 
diff --git a/boxplot_examples2.R b/boxplot_examples2.R
deleted file mode 100644
index 985fed22dc04ba33429009b2f66c4cc10d7c087a..0000000000000000000000000000000000000000
--- a/boxplot_examples2.R
+++ /dev/null
@@ -1,196 +0,0 @@
-# EXAMPLES
-
-
-set.seed(1)
-obs1 <- data.frame(
-    Time = c(rnorm(20, 100, 10), rnorm(20, 200, 50), rnorm(20, 500, 60), rnorm(20, 100, 50)), 
-    Categ1 = rep(c("CAT", "DOG"), times = 40), 
-    Categ2 = rep(c("A", "B", "C", "D"), each = 20), 
-    Color1 = rep(c("coral", "lightblue"), times = 40), 
-    Color2 = rep(c("#9F2108", "#306100", "#007479", "#8500C0"), each = 20)
-)
-set.seed(NULL)
-fun_info(obs1)
-### nice representation (1)
-# fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.class.order = list(NULL, c("B", "A", "D", "C")), box.legend.name = "LEGEND", categ.color = NULL, box.width = 0.8, dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 60, dot.size = 3.5, dot.border.size = 0.2, dot.alpha = 0.5, y.lim= c(-20, 30), stat.disp = "above", stat.size = 4, stat.dist = 1, x.lab = "GROUP", y.lab = "VALUE", vertical = FALSE, text.size = 12, title = "GRAPH1", title.text.size = 8, text.angle = 45, article = FALSE)
-
-## Mandatory arguments
-### separate boxes
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1")
-### grouped boxes
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"))
-# Order matters
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ2", "Categ1"))
-### single class
-fun_gg_boxplot(data1 = obs1[1:20, ], y = "Time", categ = "Categ2")
-fun_gg_boxplot(data1 = obs1[1:20, ], y = "Time", categ = c("Categ1", "Categ2"))
-
-### Changing the order of the classes
-# separate boxes
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.class.order = list(c("DOG", "CAT")))
-# grouped boxes
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.class.order = list(c("DOG", "CAT"), c("D", "C", "B", "A")))
-
-### Box color
-# Using a single value
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = "coral")
-# Using one value par class of Categ1
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = c("coral", "lightblue"))
-# Using a data frame column, with respect of the correspondence between Categ1 and box.color columns
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", categ.color = obs1$Color1)
-
-
-
-
-
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = "same")
-### separate boxs. Example (2) of modification of dot color, using a single color for all the dots
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = "green")
-### separate boxs. Example (3) of modification of dot color, using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = c("green", "brown"))
-### separate boxs. Example (4) of modification of dot color, using different colors for each dot
-obs1 <- data.frame(Time = 1:10, Categ1 = rep(c("G", "H"), times = 5))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = hsv(h = (1:nrow(obs1)) / nrow(obs1)))
-
-
-
-
-
-
-
-### grouped boxs. Simple example
-set.seed(1)
-obs1 <- data.frame(Time = c(rnorm(20), rnorm(20) + 2), Categ1 = rep(c("G", "H"), each = 10), Categ2 = rep(c("A", "B"), time = 10))
-set.seed(NULL)
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"))
-### grouped boxs. More grouped boxs
-obs1 <- data.frame(Time = 1:24, Categ1 = rep(c("G", "H"), times = 12), Categ2 = rep(c("A", "B", "C", "D"), each = 6))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"))
-### grouped boxs. Example (1) of modification of box color, using a single value
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.color = "white")
-### grouped boxs. Example (2) of modification of box color, using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.color = c("coral", "lightblue"))
-### grouped boxs. Example (3) of modification of box color, using one value per line of obs1, with respect of the correspondence between categ2 and box.color columns
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10), box.color = rep(c("coral", "lightblue"), each = 10))
-obs1
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), categ.color = obs1$box.color)
-### grouped boxs. Example (1) of modification of dot color, using the same dot color as the corresponding box
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "same")
-### grouped boxs. Example (2) of modification of dot color, using a single color for all the dots
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "green")
-### grouped boxs. Example (3) of modification of dot color, using one value par class of categ2
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = c("green", "brown"))
-### grouped boxs. Example (4) of modification of dot color, using different colors for each dot
-obs1 <- data.frame(Time = 1:10, Categ1 = rep(c("G", "H"), times = 5), Categ2 = rep(c("A", "B"), each = 5))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = hsv(h = (1:nrow(obs1)) / nrow(obs1)))
-### no dots (y.include.zero set to TRUE to see the lowest box):
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = NULL, y.include.zero = TRUE)
-### box width. Example (1) with box.width = 0.25 -> three times more space between single boxs than the box width (y.include.zero set to TRUE to see the lowest box)
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), each = 500))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = NULL, y.include.zero = TRUE, box.width = 0.25)
-### box width. Example (2) with box.width = 1, no space between single boxs
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), each = 500))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", dot.color = NULL, y.include.zero = TRUE, box.width = 1)
-### box width. Example (3) with box.width = 0.25 -> three times more space between sets of grouped boxs than the set width
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = NULL, y.include.zero = TRUE, box.width = 0.25)
-### box width. Example (4) with box.width = 0 -> no space between sets of grouped boxs
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = NULL, y.include.zero = TRUE, box.width = 1)
-### whisker width. Example (1) with box.whisker.width = 1 -> whiskers have the width of the corresponding box
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = NULL, box.whisker.width = 1)
-### whisker width. Example (2) error boxs with no whiskers
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = NULL, box.whisker.width = 0)
-### tidy dot distribution. Example (1)
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 100)
-### tidy dot distribution. Example (2) reducing the dot size with dot.tidy.bin.nb
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 150)
-### dot jitter. Example (1)
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "same", dot.tidy = FALSE, dot.jitter = 1, dot.size = 2) 
-### dot jitter. Example (2) with dot.jitter = 1 -> dispersion around the corresponding box width
-obs1 <- data.frame(Time = 1:1000, Categ1 = rep(c("G", "H"), times = 500), Categ2 = rep(LETTERS[1:5], each = 200))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "grey", dot.size = 3, dot.alpha = 1,  dot.jitter = 1)
-### dot jitter. Example (3) with no dispersion
-obs1 <- data.frame(Time = 1:100, Categ1 = rep(c("G", "H"), times = 50), Categ2 = rep(LETTERS[1:5], each = 20))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "grey", dot.size = 3, dot.alpha = 1,  dot.jitter = 0)
-### dot size, dot border size and dot transparency
-obs1 <- data.frame(Time = 1:100, Categ1 = rep(c("G", "H"), times = 50), Categ2 = rep(LETTERS[1:5], each = 20))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), dot.color = "grey", dot.size = 4, dot.border.size = 0, dot.alpha = 0.6)
-### y-axis limits. Example (1)
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.lim = c(-1, 25))
-### y-axis limits. Example (2) showing that order matters in y.lim argument
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.lim = c(25, -1))
-### log scale. Example (1). BEWARE: y column must be log, otherwise incoherent scale (see below warning message with the return argument)
-obs1 <- data.frame(Time = c((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10")
-### log scale. Example (2). BEWARE: values of the y.lim must be in the corresponding log
-obs1 <- data.frame(Time = c((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10", y.lim = c(100,1000))
-### tick number. Example (1)
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.tick.nb = 10)
-### tick number. Example (2) using a log2 scale
-obs1 <- data.frame(Time = log2((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log2", y.tick.nb = 10, y.lim = c(1, 16))
-### tick number. Example (3) using a log10 scale
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10", y.tick.nb = 10)
-### tick number. Example (4) using a log10 scale: the reverse y-axis correctly deal with log10 scale
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10", y.tick.nb = 10, y.lim = c(4, 1))
-### secondary tick number. Example (1)
-obs1 <- data.frame(Time = 1:20, Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.second.tick.nb = 2)
-### secondary ticks. Example (2) not for log2 and log10 scales (see below warning message with the return argument)
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10", y.second.tick.nb = 2)
-### include zero in the y-axis
-obs1 <- data.frame(Time = (1:20), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.include.zero = TRUE)
-### extra margins. To avoid dot cuts
-obs1 <- data.frame(Time = (1:20), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.top.extra.margin = 0.25, y.bottom.extra.margin = 0.25)
-### mean diplay. Example (1) at the top of the plot region
-obs1 <- data.frame(Time = (1:20), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.top.extra.margin = 0.1, stat.disp = "top", stat.size = 4, stat.dist = 2)
-### mean diplay. Example (2) above boxs
-obs1 <- data.frame(Time = (1:20), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.top.extra.margin = 0.1, stat.disp = "above", stat.size = 4, stat.dist = 2)
-### box orientation.  Example (1) without log scale, showing that the other arguments are still operational
-obs1 <- data.frame(Time = (1:20), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.tick.nb = 10, y.second.tick.nb = 2, y.include.zero = TRUE, vertical = FALSE)
-### box orientation. Example (2) with log scale. Horizontal orientation is blocked with log2 and log10 scales because of a bug in ggplot2 (https://github.com/tidyverse/ggplot2/issues/881)
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10", vertical = FALSE)
-### classic representation (use grid = TRUE to display the background lines of the y axis ticks)
-obs1 <- data.frame(Time = (1:20), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), article = TRUE, grid = FALSE)
-### graphic info. Example (1)
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), return = TRUE)
-### graphic info. Example (2) of assignation and warning message display
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-warn <- fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), y.log = "log10", return = TRUE)
-cat(warn$warnings)
-### add ggplot2 functions
-obs1 <- data.frame(Time = log10((1:20) * 100), Categ1 = rep(c("G", "H"), times = 10), Categ2 = rep(c("A", "B"), each = 10))
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Categ1", "Categ2"), add = "+ggplot2::theme_classic()")
-fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Categ1", article = FALSE, add = "+ggplot2::facet_wrap(facets = 'Categ2', labeller = 'label_both') + ggplot2::theme(strip.background = ggplot2::element_rect(color = 'grey', size = 0.5), strip.text = ggplot2::element_text(size = 10, face = 'bold'), panel.spacing = ggplot2::unit(0.5, 'lines'))")  # or ggplot2::vars(Categ2) instead of 'Categ2'. See https://ggplot2.tidyverse.org/reference/labeller.html
-
-
diff --git a/cute_little_R_functions.R b/cute_little_R_functions.R
index 55864597586776c8f2e7b3bea8c485ec7a31c0c5..edca46363719cfae6d61cdb7e344621be60bcba8 100644
--- a/cute_little_R_functions.R
+++ b/cute_little_R_functions.R
@@ -7763,8 +7763,6 @@ return(output) # do not use cat() because the idea is to reuse the message
 
 
 
-# http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/76-add-p-values-and-significance-levels-to-ggplots/
-# kind of double plotting -> solve it. It must be in the different layers -> plot twice
 
 
 fun_gg_boxplot <- function(
@@ -7777,13 +7775,13 @@ box.legend.name = NULL,
 box.fill = FALSE, 
 box.width = 0.5, 
 box.space = 0.1, 
-box.line.size = 0.5, 
+box.line.size = 0.75, 
 box.notch = FALSE, 
 box.alpha = 1, 
 box.mean = TRUE, 
 box.whisker.kind = "std", 
 box.whisker.width = 0, 
-dot.color = "black", 
+dot.color = grey(0.25), 
 dot.categ = NULL, 
 dot.categ.class.order = NULL, 
 dot.legend.name = NULL, 
@@ -7799,7 +7797,7 @@ y.lab = NULL,
 y.lim = NULL, 
 y.log = "no", 
 y.tick.nb = NULL, 
-y.second.tick.nb = NULL, 
+y.second.tick.nb = 1, 
 y.include.zero = FALSE, 
 y.top.extra.margin = 0.05, 
 y.bottom.extra.margin = 0.05, 
@@ -7820,81 +7818,86 @@ return = FALSE,
 return.ggplot = FALSE,
 plot = TRUE, 
 add = NULL, 
-warn.print = FALSE, 
+warn.print = TRUE, 
 lib.path = NULL
 ){
 # AIM
-# ggplot2 boxplot with the possibility to add background or foreground dots
+# plot ggplot2 boxplots + dots + means
 # for ggplot2 specifications, see: https://ggplot2.tidyverse.org/articles/ggplot2-specs.html
 # WARNINGS
 # Rows containing NA in data1[, c(y, categ)] will be removed before processing, with a warning (see below)
-# Hinges are not computed like in the classical boxplot() function of R. But 
-# To have a single box, create a factor column with a single class and specify the name of this column in the categ argument. For a single set of grouped boxs, create a factor column with a single class and specify this column in categ argument as first element (i.e., as categ1, knowing that categ2 must also be specified in this situation). See categ below
-# With separated boxs (categ argument with only one element), box.width argument defines each box width. The box.width argument also defines the space between boxs by using (1 - box.width). In addition, xmin and xmax of the fun_gg_boxplot() output report the box boundaries (around x-axis unit 1, 2, 3, etc., for each box)
-# With grouped boxs (categ argument with two elements), box.width argument defines each set of grouped box width. The box.width argument also defines the space between set of grouped boxs by using (1 - box.width). In addition, xmin and xmax of the fun_gg_boxplot() output report the box boundaries (around x-axis unit 1, 2, 3, etc., for each set of grouped box)
+# Hinges are not computed like in the classical boxplot() function of R. See https://ggplot2.tidyverse.org/reference/geom_boxplot.html
+# To have a single box, please create a factor column with a single class and specify the name of this column in the categ argument. For a single set of grouped boxes, create a factor column with a single class and specify this column in categ argument as first element (i.e., as categ1, knowing that categ2 must also be specified in this situation). See categ argument below
 # The dot.alpha argument can alter the display of the color boxes when using pdf output
 # Size arguments (box.line.size, dot.size, dot.border.size, stat.size, text.size and title.text.size) are in mm. See Hadley comment in https://stackoverflow.com/questions/17311917/ggplot2-the-unit-of-size. See also http://sape.inf.usi.ch/quick-reference/ggplot2/size). Unit object are not accepted, but conversion can be used (e.g., grid::convertUnit(grid::unit(0.2, "inches"), "mm", valueOnly = TRUE))
-# The function uses options(warning.length = 8170) which increases the length of warning messages
+# The function uses options(warning.length = 8170) which increases the length of warning messages. Use options(warning.length = 1000) after using fun_gg_boxplot() to go back to the default value
+# Display seems to be done twice on Windows devices (like a blink). However, no double plots on pdf devices. Thus, the blink remains mysterious
 # ARGUMENTS
-# data1: dataframe containing one column of values (see y argument below) and one or two columns of categories (see categ argument below). Duplicated column names are not allowed
-# y: character string of the data1 column name for y-axis (column containing numeric values). Numeric values will be split according to the classes of the column names indicated in the categ argument to generate the boxs and will also be used to plot the dots
-# categ: vector of character strings of the data1 column name for categories (column of characters or factor). Must be either one or two column names. If a single column name (further refered to as categ1), then one box per class of categ1. If two column names (further refered to as categ1 and categ2), then one box per class of categ2, which form a group of boxs in each class of categ1. BEWARE: no empty classes allowed. To have a single box, create a factor column with a single class and specify the name of this column in the categ argument (here, no categ2 in categ argument). For a single set of grouped boxs, create a factor column with a single class and specify this column in categ argument as first element (i.e., as categ1, knowing that categ2 must also be specified in this situation)
-# categ.class.order: list indicating the order of the classes of categ1 and categ2 represented on the boxplot (the first compartment for categ1 and and the second for categ2). If categ.class.order == NULL, classes are represented according to the alphabetical order. Some compartment can be NULL and other not
-# categ.color: vector of color character string for box frame
-#If categ.color == NULL, default colors of ggplot2, whatever categ1 and categ2
-# If categ.color is non null and only categ1 in categ argument, categ.color can be either: (1) a single color string (all the boxs will have this color, whatever the number of classes of categ1), (2) a vector of string colors, one for each class of categ1 (each color will be associated according to categ.class.order of categ1), (3) a vector or factor of string colors, like if it was one of the column of data1 data frame (beware: a single color per class of categ1 and a single class of categ1 per color must be respected). Integers are also accepted instead of character strings, as long as above rules about length are respected. Integers will be processed by fun_gg_palette() using the max integer value among all the integers in categ.color
-# If categ.color is non null and categ1 and categ2 specified, all the rules described above will apply to categ2 instead of categ1 (colors will be determined for boxs inside a group of boxs)
-# box.legend.name: character string of the legend title for categ2. If box.legend.name == NULL, then box.legend.name <- categ1 if only categ1 is present, and box.legend.name <- categ2 if categ1 and categ2 are present. Write "" if no legend required
-# box.fill: logical. Fill the box? If TRUE, the categ.color argument will be used to generate filled boxplot (the box frames being black) as well as filled outlier dots (the dot border being controled by the dot.border.color argument) and if all the dots are plotted (argument dot.color other than NULL), they will be over the boxes. If FALSE, the categ.color argument will be used to color the box frames and the outlier dot borders, and if all the dots are plotted, they will be beneath the boxes
-# box.width: numeric value (from 0 to 1) of the box or set of grouped box width (see warnings above)
-# box.space: numeric value (from 0 to 1) indicating the box separation in grouped boxes. 0 means no space and 1 means boxes shrinked to a vertical line. Ignored if no grouped boxes
-# box.line.size: numeric value of line width of boxes and whiskers in mm
-# box.notch: logical. Notched boxplot? It TRUE, display notched boxplot, the notches corresponding approximately to the 95% confidence interval of the median (the notch interval is exactly 1.58 x Inter Quartile Range (IQR) / sqrt(n), with n the number of values that made the box). If notch intervals between two boxes do not overlap, it can be interpreted as significant median differences
-# box.alpha: numeric value (from 0 to 1) of box transparency (full transparent to full opaque, respectively). BEWARE: work only for the fill of boxplots, not for the frame. See https://github.com/tidyverse/ggplot2/issues/252
-# box.mean: logical. Add mean value? It TRUE, a losange dot, additional to the solid median bar and corresponding to the mean value, is incorporated into each boxplot
+# data1: data frame containing one column of quantitative values (see the y argument below) and one or two columns of categories (see the categ argument below). Duplicated column names are not allowed
+# y: character string of the data1 column name for y-axis (column containing numeric values). Numeric values will be split according to the classes of the column names indicated in the categ argument to generate the boxes and will also be used to plot the dots
+# categ: vector of character strings of the data1 column name for categories (column of characters or factors). Must be either one or two column names. If a single column name (further referred to as categ1), then one box per class of categ1. If two column names (further referred to as categ1 and categ2), then one box per class of categ2, which form a group of boxes in each class of categ1. WARNING: no empty classes allowed. To have a single box, create a factor column with a single class and specify the name of this column in the categ argument (here, no categ2 in categ argument). For a single set of grouped boxes, create a factor column with a single class and specify this column in categ argument as first element (i.e., as categ1), in addition to the already used category (as categ2 in this situation)
+# categ.class.order: list indicating the order of the classes of categ1 and categ2 represented on the boxplot (the first compartment for categ1 and and the second for categ2). If categ.class.order == NULL, classes are represented according to the alphabetical order. Some compartments can be NULL and others not. See the categ argument for categ1 and categ2 description
+# categ.color: vector of color character string for box frames (see the categ argument for categ1 and categ2 description)
+# If categ.color == NULL, default colors of ggplot2, whatever categ1 and categ2
+# If categ.color is non-null and only categ1 in categ argument, categ.color can be either:
+# (1) a single color string. All the boxes will have this color, whatever the number of classes of categ1
+# (2) a vector of string colors, one for each class of categ1. Each color will be associated according to categ.class.order of categ1
+# (3) a vector or factor of string colors, like if it was one of the column of data1 data frame. WARNING: a single color per class of categ1 and a single class of categ1 per color must be respected
+# Integers are also accepted instead of character strings, as long as above rules about length are respected. Integers will be processed by fun_gg_palette() using the maximal integer value among all the integers in categ.color (see fun_gg_palette())
+# If categ.color is non-null and categ1 and categ2 are specified, all the rules described above will apply to categ2 instead of categ1 (colors will be determined for boxes inside a group of boxes)
+# box.legend.name: character string of the legend title. If box.legend.name is NULL, then box.legend.name <- categ1 if only categ1 is present, and box.legend.name <- categ2 if categ1 and categ2 are present in the categ argument. Write "" if no legend required. See the categ argument for categ1 and categ2 description
+# box.fill: logical. Fill the box? If TRUE, the categ.color argument will be used to generate filled boxplots (the box frames being black) as well as filled outlier dots (the dot border being controlled by the dot.border.color argument). If all the dots are plotted (argument dot.color other than NULL), they will be over the boxes. If FALSE, the categ.color argument will be used to color the box frames and the outlier dot borders. If all the dots are plotted, they will be beneath the boxes
+# box.width: single numeric value (from 0 to 1) of width of either boxes or group of boxes
+# When categ argument has a single categ1 element (i.e., separate boxes. See the categ argument for categ1 and categ2 description), then each class of categ1 is represented by a single box. In that case, box.width argument defines each box width, from 0 (no box width) to 1 (max box width), but also the space between boxes (the code uses 1 - box.width for the box spaces). Of note, xmin and xmax of the fun_gg_boxplot() output report the box boundaries (around x-axis unit 1, 2, 3, etc., for each box)
+# When categ argument has a two categ1 and categ2 elements (i.e., grouped boxes), box.width argument defines the width allocated for each set of grouped boxes, from 0 (no group width) to 1 (max group width), but also the space between grouped boxes (the code uses 1 - box.width for the spaces). Of note, xmin and xmax of the fun_gg_boxplot() output report the box boundaries (around x-axis unit 1, 2, 3, etc., for each set of grouped box)
+# box.space: single numeric value (from 0 to 1) indicating the box separation inside grouped boxes, when categ argument has a two categ1 and categ2 elements. 0 means no space and 1 means boxes shrunk to a vertical line. Ignored if categ argument has a single categ1 element
+# box.line.size: single numeric value of line width of boxes and whiskers in mm
+# box.notch: logical. Notched boxplot? It TRUE, display notched boxplot, notches corresponding approximately to the 95% confidence interval of the median (the notch interval is exactly 1.58 x Inter Quartile Range (IQR) / sqrt(n), with n the number of values that made the box). If notch intervals between two boxes do not overlap, it can be interpreted as significant median differences
+# box.alpha: single numeric value (from 0 to 1) of box transparency (full transparent to full opaque, respectively). WARNING: work only for the filling of boxes, not for the frame. See https://github.com/tidyverse/ggplot2/issues/252
+# box.mean: logical. Add mean value? If TRUE, a diamond-shaped dot, with the horizontal diagonal corresponding to the mean value, is displayed over each boxplot
 # box.whisker.kind: range of the whiskers. Either "no" (no whiskers), or "std" (length of each whisker equal to 1.5 x Inter Quartile Range (IQR)), or "max" (length of the whiskers up or down to the most distant dot)
-# box.whisker.width: numeric value (from 0 to 1) of the whisker width, with 0 meaning no whiskers and 1 meaning a width equal to the corresponding boxplot width
-# dot.color: vector of color character string for color of dots.
+# box.whisker.width: single numeric value (from 0 to 1) of the whisker width, with 0 meaning no whiskers and 1 meaning a width equal to the box width
+# dot.color: vector of color character string ruling the dot colors and the dot display. See the example section below for easier understanding of the rules described here
 # If NULL, no dots plotted
 # If "same", the dots will have the same colors as the respective boxplots
-# Otherwise, colors will depend on the dot.categ argument. If dot.categ is NULL, then colors will be applied to each class of the last column name specified in categ. If dot.categ is non NULL, colors will be applied to each class of the column name specified in dot.categ. Color strings can be (1), (2) or (3) of categ.color argument, except that in the possibility (3), the rule "a single color per class of categ and a single class of categ per color", does not have to be respected (for instance, each dot can have a different color). See examples Put in example or leave here? -> Example: with categ = "Group1", dot.color = "red" and dot.categ = NULL, all the dots will be red, whatever the classes in Group1 column of data1, and no legend will be display for dots. With categ = c("Group1", "Group2"), dot.color = c("red", "blue") and dot.categ = NULL, the dots will be red for first class of Group2 and blue for the 2nd class of Group2, and no legend will be display for dots. With categ = c("Group1", "Group2"), dot.color = c("red", "blue") and dot.categ = "Group1", the dots will be red for first class of Group1 and blue for the 2nd class of Group1, and a legend will be display for dots
-# dot.categ: optional single character string of a data1 column name (further refered to as categ3), which is associated to the dot.color argument to generate a legend for dots. If non NULL, then a legend will be created for the dots, in addition to the legend for the boxes. If NULL, no legend created and the colors of dot will depend on dot.color and categ arguments (see the explanation in dot.color)
-# dot.categ.class.order: optional vector of character strings indicating the order of the classes of categ3. If dot.categ is non NULL and dot.categ.class.order is NULL, classes are displayed in the legend according to the alphabetical order. Ignored if dot.categ is NULL
-# dot.legend.name: optional character string of the legend title for categ3. If dot.legend.name == NULL, categ3 value is used (name of the column in data1). Write "" if no legend required. Ignored if dot.categ is NULL
-# dot.tidy: logical. Nice dot spreading? If TRUE, use the geom_dotplot() function for a nice representation. BEWARE: change the true coordinates of dots that are aligned. Thus the gain in aestheticism is associated with a loss in precision that can be very important. If FALSE, dots are randomly spread, using the dot.jitter argument (see below) keeping the true dot coordinates
-# dot.tidy.bin.nb: positive integer indicating the number of bins (i.e., nb of separations) of the y.lim range. Each dot will then be put in one of the bin, with the size the width of the bin. In other words, increase the number to have smaller dots. Not considered if dot.tidy is FALSE
-# dot.jitter: numeric value (from 0 to 1) of random dot horizontal dispersion, with 0 meaning no dispersion and 1 meaning a dispersion in the corresponding box width interval. Not considered if dot.tidy is TRUE
+# Otherwise, as in the rule (1), (2) or (3) described in the categ.color argument, except that in the possibility (3), the rule "a single color per class of categ and a single class of categ per color", does not have to be respected (for instance, each dot can have a different color). Colors will also depend on the dot.categ argument. If dot.categ is NULL, then colors will be applied to each class of the last column name specified in categ. If dot.categ is non-NULL, colors will be applied to each class of the column name specified in dot.categ. See examples
+# dot.categ: optional single character string of a column name (further referred to as categ3) of the data1 argument. This column of data1 will be used to generate a legend for dots, in addition to the legend for boxes. See the dot.color argument for details about the way the legend is built using the two dot.categ and dot.color arguments. If NULL, no legend created and the colors of dots will depend on dot.color and categ arguments (as explained in the dot.color argument)
+# dot.categ.class.order: optional vector of character strings indicating the order of the classes of categ3 (see the dot.categ argument). If dot.categ is non-NULL and dot.categ.class.order is NULL, classes are displayed in the legend according to the alphabetical order. Ignored if dot.categ is NULL
+# dot.legend.name: optional character string of the legend title for categ3 (see the dot.categ argument). If dot.legend.name == NULL, dot.categ value is used (name of the column in data1). Write "" if no legend required. Ignored if dot.categ is NULL
+# dot.tidy: logical. Nice dot spreading? If TRUE, use the geom_dotplot() function for a nice representation. WARNING: change the true quantitative coordinates of dots (i.e., y-axis values for vertical display) because of binning. Thus, the gain in aestheticism is associated with a loss in precision that can be very important. If FALSE, dots are randomly spread on the qualitative axis, using the dot.jitter argument (see below) keeping the true quantitative coordinates
+# dot.tidy.bin.nb: positive integer indicating the number of bins (i.e., nb of separations) of the y.lim range. Each dot will then be put in one of the bin, with a diameter of the width of the bin. In other words, increase the number of bins to have smaller dots. Not considered if dot.tidy is FALSE
+# dot.jitter: numeric value (from 0 to 1) of random dot horizontal dispersion (for vertical display), with 0 meaning no dispersion and 1 meaning dispersion in the corresponding box width interval. Not considered if dot.tidy is TRUE
 # dot.size: numeric value of dot diameter in mm. Not considered if dot.tidy is TRUE
 # dot.alpha: numeric value (from 0 to 1) of dot transparency (full transparent to full opaque, respectively)
 # dot.border.size: numeric value of border dot width in mm. Write zero for no dot border. If dot.tidy is TRUE, value 0 remove the border and other values leave the border without size control (geom_doplot() feature)
 # dot.border.color: single character color string defining the color of the dot border (same color for all the dots, whatever their categories). If dot.border.color == NULL, the border color will be the same as the dot color. A single integer is also accepted instead of a character string, that will be processed by fun_gg_palette()
-# x.lab: a character string or expression for x-axis legend. If NULL, character string of categ1
+# x.lab: a character string or expression for x-axis legend. If NULL, character string of categ1 (see the categ argument for categ1 and categ2 description)
 # y.lab: a character string or expression for y-axis legend. If NULL, character string of the y argument
-# y.lim: 2 numeric values indicating the range of the y-axis
-# y.log: either "no", "log2" (values in the y argument column of the data1 data frame will be log2 transformed and y-axis will be log2 scaled) or "log10" (values in the y argument column of the data1 data frame will be log10 transformed and y-axis will be log10 scaled). BEWARE: not possible to have horizontal boxs with a log axis, due to a bug in ggplot2 (see https://github.com/tidyverse/ggplot2/issues/881)
-# y.tick.nb: approximate number of desired label values (i.e., main ticks) on the y-axis (n argument of the the cute::fun_scale() function). BEWARE: provide this number even if y.log is "log2" or "log10", which can be difficult to read (e.g., ..., 2^2, 2^2.5, 2^3, ...). If NULL and if y.log is "no", then the number of label values is set by ggplot2. If NULL and if y.log is "log2" or "log10", then the number of label values correspond to integer units between y.lim (e.g., ..., 2^1, 2^2, 2^3, ...)
+# y.lim: 2 numeric values indicating the range of the y-axis. Order matters (for inverted axis). If NULL, the range of the x column name of data1 will be used. 
+# y.log: either "no", "log2" (values in the y argument column of the data1 data frame will be log2 transformed and y-axis will be log2 scaled) or "log10" (values in the y argument column of the data1 data frame will be log10 transformed and y-axis will be log10 scaled). WARNING: not possible to have horizontal boxes with a log axis, due to a bug in ggplot2 (see https://github.com/tidyverse/ggplot2/issues/881)
+# y.tick.nb: approximate number of desired values labeling the y-axis (i.e., main ticks, see the n argument of the the cute::fun_scale() function). If NULL and if y.log is "no", then the number of labeling values is set by ggplot2. If NULL and if y.log is "log2" or "log10", then the number of labeling values corresponds to all the exposant integers in the y.lim range (e.g., 10^1, 10^2 and 10^3, meaning 3 main ticks for y.lim = c(9, 1200)). WARNING: if non-NULL and if y.log is "log2" or "log10", labeling can be difficult to read (e.g., ..., 10^2, 10^2.5, 10^3, ...)
 # y.second.tick.nb: number of desired secondary ticks between main ticks. Ignored if y.log is other than "no" (log scale plotted). Use argument return = TRUE and see $plot$y.second.tick.values to have the values associated to secondary ticks. IF NULL, no secondary ticks
 # y.include.zero: logical. Does y.lim range include 0? Ignored if y.log is "log2" or "log10"
-# y.top.extra.margin: single proportion (between 0 and 1) indicating if extra margins must be added to y.lim. If different from 0, add the range of the axis * y.top.extra.margin (e.g., abs(y.lim[2] - y.lim[1]) * y.top.extra.margin) to the top of y-axis
+# y.top.extra.margin: single proportion (between 0 and 1) indicating if extra margins must be added to y.lim. If different from 0, add the range of the axis multiplied by y.top.extra.margin (e.g., abs(y.lim[2] - y.lim[1]) * y.top.extra.margin) to the top of y-axis
 # y.bottom.extra.margin: idem as y.top.extra.margin but to the bottom of y-axis
-# stat.disp: add the median number above the corresponding box. Either NULL (no number shown), "top" (at the top of the figure region) or "above" (above each box)
-# stat.disp.mean: logical. Diplay means instead of medians ?
-# stat.size: numeric value of the stat font size in mm
-# stat.dist: numeric value of the stat distance. Increase the value to increase the distance from the box plot
-# vertical: logical. Vertical boxs? BEWARE: will be automatically set to TRUE if y.log argument is other than "no". Indeed, not possible to have horizontal boxs with a log axis, due to a bug in ggplot2 (see https://github.com/tidyverse/ggplot2/issues/881)
-# text.size: numeric value of the font size of the (1) axis numbers and axis legends, (2) texts in the graphic legend, (3) stats above boxs (in mm)
-# text.angle: integer value of the text angle for the x-axis labels. Positive values for counterclockwise rotation: 0 for horizontal, 90 for vertical, 180 for upside down etc. Negative values for clockwise rotation: 0 for horizontal, -90 for vertical, -180 for upside down etc.
+# stat.disp: add the median number above the corresponding box. Either NULL (no number shown), "top" (at the top of the plot region) or "above" (above each box)
+# stat.disp.mean: logical. Display mean numbers instead of median numbers? Ignored if stat.disp is NULL
+# stat.size: numeric value of the stat font size in mm. Ignored if stat.disp is NULL
+# stat.dist: numeric value of the stat distance (in the unit of the hjust and vjust arguments of ggplot2::annotate() function). Increase the value to increase the distance from the box plot. Ignored if stat.disp is NULL or "top"
+# vertical: logical. Vertical boxes? WARNING: will be automatically set to TRUE if y.log argument is other than "no". Indeed, not possible to have horizontal boxes with a log axis, due to a bug in ggplot2 (see https://github.com/tidyverse/ggplot2/issues/881)
+# text.size: numeric value of the font size of the (1) axis numbers, (2) axis labels and (3) texts in the graphic legend (in mm)
+# text.angle: integer value of the text angle for the x-axis numbers, using the same rules as in ggplot2. Positive values for counterclockwise rotation: 0 for horizontal, 90 for vertical, 180 for upside down etc. Negative values for clockwise rotation: 0 for horizontal, -90 for vertical, -180 for upside down etc.
 # title: character string of the graph title
 # title.text.size: numeric value of the title font size in mm
-# legend.show: logical. Show legend? Not considered if categ argument is NULL, because this already generate no legend, excepted if legend.width argument is non NULL. In that specific case (categ is NULL, legend.show is TRUE and legend.width is non NULL), an empty legend space is created. This can be useful when desiring graphs of exactly the same width, whatever they have legends or not
-# legend.width: single proportion (between 0 and 1) indicating the relative width of the legend sector (on the right of the plot) relative to the width of the plot. Value 1 means that the window device width is split in 2, half for the plot and half for the legend. Value 0 means no room for the legend which will overlay the plot region. Write NULL to inactivate the legend sector. In such case, ggplot2 will manage the room required for the legend display, meaning that the width of the plotting region can vary between graphs, depending on the text in the legend
-# article: logical. If TRUE, use a article theme (article like). If FALSE, use a classic related ggplot theme. Use the add argument (add = "+ggplot2::theme_classic()" for the exact classic ggplot theme
-# grid: logical. Draw horizontal lines in the background to better read the box values? Not considered if article == FALSE
+# legend.show: logical. Show legend? Not considered if categ argument is NULL, because this already generate no legend, excepted if legend.width argument is non-NULL. In that specific case (categ is NULL, legend.show is TRUE and legend.width is non-NULL), an empty legend space is created. This can be useful when desiring graphs of exactly the same width, whatever they have legends or not
+# legend.width: single proportion (between 0 and 1) indicating the relative width of the legend sector (on the right of the plot) relative to the width of the plot. Value 1 means that the window device width is split in 2, half for the plot and half for the legend. Value 0 means no room for the legend, which will overlay the plot region. Write NULL to inactivate the legend sector. In such case, ggplot2 will manage the room required for the legend display, meaning that the width of the plotting region can vary between graphs, depending on the text in the legend
+# article: logical. If TRUE, use an article theme (article like). If FALSE, use a classic related ggplot theme. Use the add argument (e.g., add = "+ggplot2::theme_classic()" for the exact classic ggplot theme
+# grid: logical. Draw lines in the background to better read the box values? Not considered if article == FALSE (grid systematically present)
 # return: logical. Return the graph parameters?
 # return.ggplot: logical. Return the ggplot object in the output list? Ignored if return argument is FALSE. WARNING: always assign the fun_gg_boxplot() function (e.g., a <- fun_gg_boxplot()) if return.ggplot argument is TRUE, otherwise, double plotting is performed. See $ggplot in the RETURN section below for more details
 # plot: logical. Plot the graphic? If FALSE and return argument is TRUE, graphical parameters and associated warnings are provided without plotting
 # add: character string allowing to add more ggplot2 features (dots, lines, themes, facet, etc.). Ignored if NULL
-# BEWARE: (1) the string must start with "+", (2) the string must finish with ")" and (3) each function must be preceded by "ggplot2::". Example: "+ ggplot2::coord_flip() + ggplot2::theme_bw()"
+# WARNING: (1) the string must start with "+", (2) the string must finish with ")" and (3) each function must be preceded by "ggplot2::". Example: "+ ggplot2::coord_flip() + ggplot2::theme_bw()"
 # If the character string contains the "ggplot2::theme" string, then the article argument of fun_gg_boxplot() (see above) is ignored with a warning
 # Handle the add argument with caution since added functions can create conflicts with the preexisting internal ggplot2 functions
 # warn.print: logical. Print warnings at the end of the execution? ? If FALSE, warning messages are never printed, but can still be recovered in the returned list. Some of the warning messages (those delivered by the internal ggplot2 functions) are not apparent when using the argument plot = FALSE
@@ -7902,7 +7905,7 @@ lib.path = NULL
 # REQUIRED PACKAGES
 # ggplot2
 # scales
-# REQUIRED FUNCTIONS FROM CUTE_LITTLE_R_FUNCTION
+# REQUIRED FUNCTIONS FROM THE cute PACKAGE
 # fun_check()
 # fun_comp_1d()
 # fun_comp_2d()
@@ -7928,21 +7931,20 @@ lib.path = NULL
 # $inf.whisker: coordinates of bottom whiskers (y for base and y.end for extremities)
 # $sup.whisker.edge: coordinates of top whisker edges (x and xend)
 # $inf.whisker.edge: coordinates of bottom whisker edges(x and xend)
-# $mean: diamon mean coordinates (only if box.mean argument is TRUE)
+# $mean: diamond mean coordinates (only if box.mean argument is TRUE)
 # $stat.display.positive: coordinates of stat numbers when positive (only if stat.disp argument is TRUE)
 # $stat.display.negative: coordinates of stat numbers when negative (only if stat.disp argument is TRUE)
-# y.second.tick.positions: coordinates of secondary ticks (only if y.second.tick.nb argument is non NULL or if y.log argument is different from "no")
-# y.second.tick.values: values of secondary ticks. NULL except if y.second.tick.nb argument is non NULL or if y.log argument is different from "no")
-# $panel: the variable names used for the panels (NULL if no panels). BEWARE: NA can be present according to ggplot2 upgrade to v3.3.0
+# y.second.tick.positions: coordinates of secondary ticks (only if y.second.tick.nb argument is non-NULL or if y.log argument is different from "no")
+# y.second.tick.values: values of secondary ticks. NULL except if y.second.tick.nb argument is non-NULL or if y.log argument is different from "no")
+# $panel: the variable names used for the panels (NULL if no panels). WARNING: NA can be present according to ggplot2 upgrade to v3.3.0
 # $axes: the x-axis and y-axis info
-# $warn: the warning messages. Use cat() for proper display. NULL if no warning. BEWARE: some of the warning messages (those delivered by the internal ggplot2 functions) are not apparent when using the argument plot = FALSE
-# $ggplot: ggplot object that can be used for reprint (use print($ggplot) or update (use $ggplot + ggplot2::...). NULL if return.ggplot argument is FALSE. Of note, a non NULL $ggplot in the output list is sometimes annoying as the manipulation of this list prints the plot
+# $warn: the warning messages. Use cat() for proper display. NULL if no warning. WARNING: warning messages delivered by the internal ggplot2 functions are not apparent when using the argument plot = FALSE
+# $ggplot: ggplot object that can be used for reprint (use print(...$ggplot) or update (use ...$ggplot + ggplot2::...). NULL if return.ggplot argument is FALSE. Of note, a non-NULL $ggplot in the output list is sometimes annoying as the manipulation of this list prints the plot
 # EXAMPLE
-# obs1 <- data.frame(x = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep(c("A", "B"), each = 10)) ; fun_gg_boxplot(data1 = obs1, y = "x", categ = c("Group1", "Group2"), categ.class.order = list(NULL, c("B", "A")), box.legend.name = "", categ.color = c("red", "blue"),box.fill = FALSE, box.width = 0.5, box.space = 0.1, box.line.size = 0.5, box.notch = FALSE, box.alpha = 1, box.mean = TRUE, box.whisker.kind = "std", box.whisker.width = 0, dot.color = "black", dot.categ = NULL, dot.categ.class.order = NULL, dot.legend.name = NULL, dot.tidy = TRUE, dot.tidy.bin.nb = 50, dot.jitter = 0.5, dot.size = 3, dot.alpha = 0.5, dot.border.size = 0.5, dot.border.color = NULL, x.lab = NULL, y.lab = NULL, y.lim = NULL, y.log = "no", y.tick.nb = NULL, y.second.tick.nb = NULL, y.include.zero = FALSE, y.top.extra.margin = 0.05, y.bottom.extra.margin = 0.05, stat.disp = NULL, stat.disp.mean = FALSE, stat.size = 4, stat.dist = 2, vertical = TRUE, text.size = 12, text.angle = 0, title = "", title.text.size = 8, legend.width = 0.5, article = TRUE, grid = FALSE, return = FALSE, return.ggplot = FALSE, plot = TRUE, add = NULL, warn.print = TRUE, lib.path = NULL)
 # DEBUGGING
-# set.seed(1) ; obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10)) ; set.seed(NULL) ; obs1$Time[1:10] <- NA ; data1 = obs1 ; y = "Time" ; categ = c("Group1") ; categ.class.order = NULL ; box.legend.name = NULL ; categ.color = c("green") ; box.fill = FALSE ; box.width = 0.5 ; box.space = 0.1 ; box.notch = FALSE ; box.line.size = 0.5 ; box.alpha = 0.5 ; box.mean = TRUE ; box.whisker.kind = "std" ; box.whisker.width = 0.5 ; dot.color = "black" ; dot.categ = "Group1"; dot.categ.class.order = c("G", "H") ; dot.legend.name = NULL ; dot.tidy = TRUE ; dot.tidy.bin.nb = 50 ; dot.jitter = 0.25 ; dot.size = 3 ;  dot.alpha = 0.5 ; dot.border.size = 0.5 ; dot.border.color = NULL ; y.lim = NULL ; y.log = "no" ; y.tick.nb = NULL ; y.second.tick.nb = NULL ; y.include.zero = FALSE ; y.top.extra.margin = 0.05 ; y.bottom.extra.margin = 0.05 ; stat.disp = NULL ; stat.disp.mean = FALSE ; stat.size = 4 ; stat.dist = 2 ; x.lab = NULL ; y.lab = NULL ; vertical = TRUE ; text.size = 12 ; title = "" ; title.text.size = 8 ; legend.width = 0.5 ; text.angle = 0 ; article = FALSE ; grid = FALSE ; return = TRUE ; return.ggplot = FALSE ; plot = TRUE ; add = NULL ; warn.print = FALSE ; lib.path = NULL
-# set.seed(1) ; obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10), Group2 = rep(c("A", "B"), time = 10), Group3 = rep(c("I", "J"), time = 10)) ; set.seed(NULL) ; obs1$Time[1:10] <- NA ; data1 = obs1 ; y = "Time" ; categ = c("Group1", "Group2") ; categ.class.order = list(c("G", "H"), c("A", "B")); box.legend.name = NULL ; categ.color = c("green", "blue") ; box.fill = FALSE ; box.width = 0.5 ; box.space = 0.1 ; box.notch = FALSE ; box.line.size = 0.5 ; box.alpha = 0.5 ; box.mean = TRUE ; box.whisker.kind = "std" ; box.whisker.width = 0.5 ; dot.color = "black" ; dot.categ = "Group1" ; dot.categ.class.order = NULL ; dot.legend.name = NULL ; dot.tidy = TRUE ; dot.tidy.bin.nb = 30 ; dot.jitter = 0.25 ; dot.size = 3 ;  dot.alpha = 0.5 ; dot.border.size = 0.5 ; dot.border.color = NULL ; y.lim = NULL ; y.log = "no" ; y.tick.nb = NULL ; y.second.tick.nb = NULL ; y.include.zero = FALSE ; y.top.extra.margin = 0.05 ; y.bottom.extra.margin = 0.05 ; stat.disp = NULL ; stat.disp.mean = FALSE ; stat.size = 4 ; stat.dist = 2 ; x.lab = NULL ; y.lab = NULL ; vertical = TRUE ; text.size = 12 ; title = "" ; title.text.size = 8 ; legend.width = 0.5 ; text.angle = 0 ; article = FALSE ; grid = FALSE ; return = FALSE ; return.ggplot = FALSE ; plot = TRUE ; add = NULL ; warn.print = FALSE ; lib.path = NULL
-# set.seed(1) ; obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10), Group2 = rep(c("A", "B"), time = 10)) ; set.seed(NULL) ; data1 = obs1 ; y = "Time" ; categ = c("Group1") ; categ.class.order = list(c("H", "G")); box.legend.name = NULL ; categ.color = c("blue") ; box.fill = FALSE ; box.width = 0.5 ; box.space = 0.1 ; box.notch = TRUE ; box.line.size = 1 ; box.alpha = 1 ; box.mean = FALSE ; box.whisker.kind = "max" ; box.whisker.width = 0 ; dot.color = "black" ; dot.categ = "Group1" ; dot.categ.class.order = NULL ; dot.legend.name = NULL ; dot.tidy = TRUE ; dot.tidy.bin.nb = 30 ; dot.jitter = 0.25 ; dot.size = 3 ;  dot.alpha = 0.5 ; dot.border.size = 0.5 ; dot.border.color = NULL ; y.lim = NULL ; y.log = "log10" ; y.tick.nb = NULL ; y.second.tick.nb = NULL ; y.include.zero = FALSE ; y.top.extra.margin = 0.05 ; y.bottom.extra.margin = 0.05 ; stat.disp = NULL ; stat.disp.mean = FALSE ; stat.size = 4 ; stat.dist = 2 ; x.lab = NULL ; y.lab = NULL ; vertical = TRUE ; text.size = 12 ; title = "" ; title.text.size = 8 ; legend.width = 0.5 ; text.angle = 0 ; article = FALSE ; grid = FALSE ; return = FALSE ; return.ggplot = FALSE ; plot = TRUE ; add = NULL ; warn.print = FALSE ; lib.path = NULL
+# set.seed(1) ; obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10)) ; set.seed(NULL) ; obs1$Time[1:10] <- NA ; data1 = obs1 ; y = "Time" ; categ = c("Group1") ; categ.class.order = NULL ; box.legend.name = NULL ; categ.color = c("green") ; box.fill = FALSE ; box.width = 0.5 ; box.space = 0.1 ; box.notch = FALSE ; box.line.size = 0.5 ; box.alpha = 0.5 ; box.mean = TRUE ; box.whisker.kind = "std" ; box.whisker.width = 0.5 ; dot.color = "black" ; dot.categ = "Group1"; dot.categ.class.order = c("G", "H") ; dot.legend.name = NULL ; dot.tidy = TRUE ; dot.tidy.bin.nb = 50 ; dot.jitter = 0.25 ; dot.size = 3 ; dot.alpha = 0.5 ; dot.border.size = 0.5 ; dot.border.color = NULL ; y.lim = NULL ; y.log = "no" ; y.tick.nb = NULL ; y.second.tick.nb = NULL ; y.include.zero = FALSE ; y.top.extra.margin = 0.05 ; y.bottom.extra.margin = 0.05 ; stat.disp = NULL ; stat.disp.mean = FALSE ; stat.size = 4 ; stat.dist = 2 ; x.lab = NULL ; y.lab = NULL ; vertical = TRUE ; text.size = 12 ; title = "" ; title.text.size = 8 ; legend.width = 0.5 ; text.angle = 0 ; article = FALSE ; grid = FALSE ; return = TRUE ; return.ggplot = FALSE ; plot = TRUE ; add = NULL ; warn.print = FALSE ; lib.path = NULL
+# set.seed(1) ; obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10), Group2 = rep(c("A", "B"), time = 10), Group3 = rep(c("I", "J"), time = 10)) ; set.seed(NULL) ; obs1$Time[1:10] <- NA ; data1 = obs1 ; y = "Time" ; categ = c("Group1", "Group2") ; categ.class.order = list(c("G", "H"), c("A", "B")); box.legend.name = NULL ; categ.color = c("green", "blue") ; box.fill = FALSE ; box.width = 0.5 ; box.space = 0.1 ; box.notch = FALSE ; box.line.size = 0.5 ; box.alpha = 0.5 ; box.mean = TRUE ; box.whisker.kind = "std" ; box.whisker.width = 0.5 ; dot.color = "black" ; dot.categ = "Group1" ; dot.categ.class.order = NULL ; dot.legend.name = NULL ; dot.tidy = TRUE ; dot.tidy.bin.nb = 30 ; dot.jitter = 0.25 ; dot.size = 3 ; dot.alpha = 0.5 ; dot.border.size = 0.5 ; dot.border.color = NULL ; y.lim = NULL ; y.log = "no" ; y.tick.nb = NULL ; y.second.tick.nb = NULL ; y.include.zero = FALSE ; y.top.extra.margin = 0.05 ; y.bottom.extra.margin = 0.05 ; stat.disp = NULL ; stat.disp.mean = FALSE ; stat.size = 4 ; stat.dist = 2 ; x.lab = NULL ; y.lab = NULL ; vertical = TRUE ; text.size = 12 ; title = "" ; title.text.size = 8 ; legend.width = 0.5 ; text.angle = 0 ; article = FALSE ; grid = FALSE ; return = FALSE ; return.ggplot = FALSE ; plot = TRUE ; add = NULL ; warn.print = FALSE ; lib.path = NULL
+# set.seed(1) ; obs1 <- data.frame(Time = c(rnorm(10), rnorm(10) + 2), Group1 = rep(c("G", "H"), each = 10), Group2 = rep(c("A", "B"), time = 10)) ; set.seed(NULL) ; data1 = obs1 ; y = "Time" ; categ = c("Group1") ; categ.class.order = list(c("H", "G")); box.legend.name = NULL ; categ.color = c("blue") ; box.fill = FALSE ; box.width = 0.5 ; box.space = 0.1 ; box.notch = TRUE ; box.line.size = 1 ; box.alpha = 1 ; box.mean = FALSE ; box.whisker.kind = "max" ; box.whisker.width = 0 ; dot.color = "black" ; dot.categ = "Group1" ; dot.categ.class.order = NULL ; dot.legend.name = NULL ; dot.tidy = TRUE ; dot.tidy.bin.nb = 30 ; dot.jitter = 0.25 ; dot.size = 3 ; dot.alpha = 0.5 ; dot.border.size = 0.5 ; dot.border.color = NULL ; y.lim = NULL ; y.log = "log10" ; y.tick.nb = NULL ; y.second.tick.nb = NULL ; y.include.zero = FALSE ; y.top.extra.margin = 0.05 ; y.bottom.extra.margin = 0.05 ; stat.disp = NULL ; stat.disp.mean = FALSE ; stat.size = 4 ; stat.dist = 2 ; x.lab = NULL ; y.lab = NULL ; vertical = TRUE ; text.size = 12 ; title = "" ; title.text.size = 8 ; legend.width = 0.5 ; text.angle = 0 ; article = FALSE ; grid = FALSE ; return = FALSE ; return.ggplot = FALSE ; plot = TRUE ; add = NULL ; warn.print = FALSE ; lib.path = NULL
 # function name
 function.name <- paste0(as.list(match.call(expand.dots=FALSE))[[1]], "()")
 arg.user.setting <- as.list(match.call(expand.dots=FALSE))[-1] # list of the argument settings (excluding default values not provided by the user)
@@ -8238,14 +8240,14 @@ warn.count <- warn.count + 1
 tempo.warn <- paste0("(", warn.count,") IN y ARGUMENT (COLUMN NAMES OF data1 ARGUMENT),\n", tempo.output$ini[i2], " HAS BEEN REPLACED BY ", tempo.output$post[i2], "\nBECAUSE RISK OF BUG AS SOME NAMES IN y ARGUMENT ARE RESERVED WORD USED BY THE ", function.name, " FUNCTION")
 warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn)))
 }
-# BEWARE: names of y argument potentially replaced
+# WARNING: names of y argument potentially replaced
 if(any(categ == tempo.output$ini[i2])){
 categ[categ == tempo.output$ini[i2]] <- tempo.output$post[i2]
 warn.count <- warn.count + 1
 tempo.warn <- paste0("(", warn.count,") IN categ ARGUMENT (COLUMN NAMES OF data1 ARGUMENT),\n", tempo.output$ini[i2], " HAS BEEN REPLACED BY ", tempo.output$post[i2], "\nBECAUSE RISK OF BUG AS SOME NAMES IN categ ARGUMENT ARE RESERVED WORD USED BY THE ", function.name, " FUNCTION")
 warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn)))
 }
-# BEWARE: names of categ argument potentially replaced
+# WARNING: names of categ argument potentially replaced
 if( ! is.null(dot.categ)){
 if(any(dot.categ == tempo.output$ini[i2])){
 dot.categ[dot.categ == tempo.output$ini[i2]] <- tempo.output$post[i2]
@@ -8254,7 +8256,7 @@ tempo.warn <- paste0("(", warn.count,") IN dot.categ ARGUMENT (COLUMN NAMES OF d
 warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn)))
 }
 }
-# BEWARE: names of dot.categ argument potentially replaced
+# WARNING: names of dot.categ argument potentially replaced
 }
 warn.count <- warn.count + 1
 tempo.warn <- paste0("(", warn.count,") REGARDING COLUMN NAMES REPLACEMENT, THE NAMES\n", paste(tempo.output$ini, collapse = " "), "\nHAVE BEEN REPLACED BY\n", paste(tempo.output$post, collapse = " "))
@@ -8275,7 +8277,7 @@ stop(tempo.cat, call. = FALSE)
 }else if( ! grepl(pattern = "(ggplot2|lemon)\\s*::", add)){ #
 tempo.cat <- paste0("ERROR IN ", function.name, ": FOR EASIER FUNCTION DETECTION, add ARGUMENT MUST CONTAIN \"ggplot2::\" OR \"lemon::\" IN FRONT OF EACH GGPLOT2 FUNCTION: ", paste(unique(add), collapse = " "))
 stop(tempo.cat, call. = FALSE)
-}else if( ! grepl(pattern = ")\\s*$", add)){ # check that the add string  finished by )
+}else if( ! grepl(pattern = ")\\s*$", add)){ # check that the add string finished by )
 tempo.cat <- paste0("ERROR IN ", function.name, ": add ARGUMENT MUST FINISH BY \")\": ", paste(unique(add), collapse = " "))
 stop(tempo.cat, call. = FALSE)
 }
@@ -8300,7 +8302,7 @@ facet.categ <- c(names(tempo1$params$rows), names(tempo1$params$cols))
 tempo.text <- "facet_grid OR facet_rep_grid"
 facet.check <- FALSE
 }
-if(facet.check == FALSE & ! all(facet.categ %in% names(data1))){ # BEWARE: all(facet.categ %in% names(data1)) is TRUE when facet.categ is NULL
+if(facet.check == FALSE & ! all(facet.categ %in% names(data1))){ # WARNING: all(facet.categ %in% names(data1)) is TRUE when facet.categ is NULL
 tempo.cat <- paste0("ERROR IN ", function.name, "\nDETECTION OF \"", tempo.text, "\" STRING IN THE add ARGUMENT BUT PROBLEM OF VARIABLE DETECTION (COLUMN NAMES OF data1)\nTHE DETECTED VARIABLES ARE:\n", paste(facet.categ, collapse = " "), "\nTHE data1 COLUMN NAMES ARE:\n", paste(names(data1), collapse = " "), "\nPLEASE REWRITE THE add STRING AND RERUN")
 stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE)
 }
@@ -8462,7 +8464,7 @@ names(data1)[names(data1) == "dot.categ"] <- dot.categ # paste0(dot.categ, "_DOT
 # stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE)
 }
 tempo1 <- fun_check(data = data1[, dot.categ], data.name = paste0(dot.categ, " COLUMN OF data1"), class = "vector", mode = "character", na.contain = TRUE, fun.name = function.name)
-tempo2 <- fun_check(data =  data1[, dot.categ], data.name = paste0(dot.categ, " COLUMN OF data1"), class = "factor", na.contain = TRUE, fun.name = function.name)
+tempo2 <- fun_check(data = data1[, dot.categ], data.name = paste0(dot.categ, " COLUMN OF data1"), class = "factor", na.contain = TRUE, fun.name = function.name)
 if(tempo1$problem == TRUE & tempo2$problem == TRUE){
 tempo.cat <- paste0("ERROR IN ", function.name, "\ndot.categ COLUMN MUST BE A FACTOR OR CHARACTER VECTOR") #
 stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE)
@@ -8663,7 +8665,7 @@ y.include.zero <- FALSE
 if(y.log != "no" & vertical == FALSE){
 vertical <- TRUE
 warn.count <- warn.count + 1
-tempo.warn <- paste0("(", warn.count,") BECAUSE OF A BUG IN ggplot2, CANNOT FLIP BOXS HORIZONTALLY WITH A Y.LOG SCALE -> vertical ARGUMENT RESET TO TRUE")
+tempo.warn <- paste0("(", warn.count,") BECAUSE OF A BUG IN ggplot2, CANNOT FLIP BOXES HORIZONTALLY WITH A Y.LOG SCALE -> vertical ARGUMENT RESET TO TRUE")
 warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn)))
 }
 # end management of log scale
@@ -8715,7 +8717,7 @@ data1[, column.check[i2]] <- factor(as.character(data1[, column.check[i2]]), lev
 }
 if( ! is.null(dot.color) & ! is.null(dot.categ)){ # reminder : dot.categ cannot be a column name of categ anymore (because in that case dot.categ name is changed into "..._DOT"
 if(column.check[i2] == ini.dot.categ){
-dot.categ.class.order <- levels(data1[, column.check[i2]])[levels(data1[,  column.check[i2]]) %in% unique(data1[, column.check[i2]])] # remove the absent color in the character vector
+dot.categ.class.order <- levels(data1[, column.check[i2]])[levels(data1[, column.check[i2]]) %in% unique(data1[, column.check[i2]])] # remove the absent color in the character vector
 data1[, column.check[i2]] <- factor(as.character(data1[, column.check[i2]]), levels = unique(dot.categ.class.order))
 }
 }
@@ -8749,7 +8751,7 @@ removed.rows <- NULL
 if(length(categ) == 1){
 # width commputations
 box.width2 <- box.width
-box.space <- 0 # to inactivate the shrink that add space between grouped boxes, because  no grouped boxes here
+box.space <- 0 # to inactivate the shrink that add space between grouped boxes, because no grouped boxes here
 # end width commputations
 # data1 check categ order for dots coordinates recovery
 data1 <- data.frame(data1, categ.check = data1[, categ[1]])
@@ -8761,12 +8763,12 @@ tempo.gg.count <- 0
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), eval(parse(text = paste0("ggplot2::ggplot()", if(is.null(add)){""}else{add})))) # add added here to have the facets
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_point(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, color = categ[1]), stroke = dot.border.size, size = dot.size, alpha = dot.alpha, shape = 21))
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "color", name = box.legend.name, values = if(is.null(dot.color)){rep(NA, length(unique(data1[, categ[1]])))}else if(length(dot.color) == 1){rep(dot.color, length(unique(data1[, categ[1]])))}else{dot.color}))
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_boxplot(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, fill = categ[1]), coef = if(box.whisker.kind == "no"){0}else if(box.whisker.kind == "std"){1.5}else if(box.whisker.kind == "max"){Inf})) # fill because this is what is used with geom_box # to easily have the equivalent of the grouped boxs
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_boxplot(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, fill = categ[1]), coef = if(box.whisker.kind == "no"){0}else if(box.whisker.kind == "std"){1.5}else if(box.whisker.kind == "max"){Inf})) # fill because this is what is used with geom_box # to easily have the equivalent of the grouped boxes
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values = if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[1]])))}else{categ.color}))
 # end per box dots coordinates recovery
 }else if(length(categ) == 2){
 # width commputations
-box.width2 <- box.width / length(unique(data1[, categ[length(categ)]])) # real width of each box in x-axis unit, among the set of grouped box. Not relevant if no grouped boxs length(categ) == 1
+box.width2 <- box.width / length(unique(data1[, categ[length(categ)]])) # real width of each box in x-axis unit, among the set of grouped box. Not relevant if no grouped boxes length(categ) == 1
 # end width commputations
 # data1 check categ order for dots coordinates recovery
 tempo.factor <- paste0(data1[order(data1[, categ[2]], data1[, categ[1]]), categ[2]], "_", data1[order(data1[, categ[2]], data1[, categ[1]]), categ[1]])
@@ -8779,7 +8781,7 @@ tempo.gg.count <- 0
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), eval(parse(text = paste0("ggplot2::ggplot()", if(is.null(add)){""}else{add})))) # add added here to have the facets
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_point(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, color = categ[2]), stroke = dot.border.size, size = dot.size, alpha = dot.alpha, shape = 21))
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "color", name = box.legend.name, values = if(is.null(dot.color)){rep(NA, length(unique(data1[, categ[2]])))}else if(length(dot.color) == 1){rep(dot.color, length(unique(data1[, categ[2]])))}else{dot.color}))
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_boxplot(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, fill = categ[2]), coef = if(box.whisker.kind == "no"){0}else if(box.whisker.kind == "std"){1.5}else if(box.whisker.kind == "max"){Inf})) # fill because this is what is used with geom_box # to easily have the equivalent of the grouped boxs
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_boxplot(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, fill = categ[2]), coef = if(box.whisker.kind == "no"){0}else if(box.whisker.kind == "std"){1.5}else if(box.whisker.kind == "max"){Inf})) # fill because this is what is used with geom_box # to easily have the equivalent of the grouped boxes
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values = if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[2]])))}else{categ.color}))
 # end per box dots coordinates recovery
 }else{
@@ -8954,7 +8956,7 @@ add.check <- FALSE
 }
 }
 if(add.check == TRUE & article == TRUE){
-# BEWARE: not possible to add theme()several times. NO message but the last one overwrites the others
+# WARNING: not possible to add theme()several times. NO message but the last one overwrites the others
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::theme_classic(base_size = text.size))
 if(grid == TRUE){
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), m.gg <- ggplot2::theme(
@@ -9010,7 +9012,7 @@ assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geo
 
 
 # x coordinates management (for random plotting and for stat display)
-# boxs
+# boxes
 tempo.graph.info <- ggplot2::ggplot_build(eval(parse(text = paste0(paste(paste0(tempo.gg.name, 1:tempo.gg.count), collapse = " + "), ' + ggplot2::geom_boxplot(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, fill = categ[length(categ)]), position = ggplot2::position_dodge(width = NULL), width = box.width, notch = box.notch, coef = if(box.whisker.kind == "no"){0}else if(box.whisker.kind == "std"){1.5}else if(box.whisker.kind == "max"){Inf}) + ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values = if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[length(categ)]])))}else{categ.color})')))) # will be recovered later again, when ylim will be considered
 tempo.yx.ratio <- (tempo.graph.info$layout$panel_params[[1]]$y.range[2] - tempo.graph.info$layout$panel_params[[1]]$y.range[1]) / (tempo.graph.info$layout$panel_params[[1]]$x.range[2] - tempo.graph.info$layout$panel_params[[1]]$x.range[1])
 box.coord <- tempo.graph.info$data[[2]] # to have the summary statistics of the plot. Contrary to ini.box.plot, now integrates ylim Here because can be required for stat.disp when just box are plotted
@@ -9043,7 +9045,7 @@ stat,
 X = box.coord$x, 
 X_BOX_INF = box.coord$xmin + width.correct, 
 X_BOX_SUP = box.coord$xmax - width.correct, 
-X_NOTCH_INF = box.coord$x - (box.coord$x - (box.coord$xmin + width.correct)) / 2,  
+X_NOTCH_INF = box.coord$x - (box.coord$x - (box.coord$xmin + width.correct)) / 2, 
 X_NOTCH_SUP = box.coord$x + (box.coord$x - (box.coord$xmin + width.correct)) / 2, 
 X_WHISK_INF = box.coord$x - (box.coord$x - (box.coord$xmin + width.correct)) * box.whisker.width, 
 X_WHISK_SUP = box.coord$x + (box.coord$x - (box.coord$xmin + width.correct)) * box.whisker.width, 
@@ -9057,20 +9059,20 @@ tempo.warn <- paste0("(", warn.count,") SOME NOTCHES ARE BEYOND BOX HINGES. TRY
 warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn)))
 }
 }
-dot.jitter <- c((box.coord$xmax - width.correct) - (box.coord$xmin + width.correct))[1] * dot.jitter # real dot.jitter. (box.coord$xmin + width.correct) - (box.coord$xmax - width.correct))[1] is the width of the box. Is  equivalent to (box.coord$x - (box.coord$xmin + width.correct))[1] * 2
+dot.jitter <- c((box.coord$xmax - width.correct) - (box.coord$xmin + width.correct))[1] * dot.jitter # real dot.jitter. (box.coord$xmin + width.correct) - (box.coord$xmax - width.correct))[1] is the width of the box. Is equivalent to (box.coord$x - (box.coord$xmin + width.correct))[1] * 2
 # end width commputations
-# end boxs
+# end boxes
 if( ! is.null(dot.color)){
 # random dots
 if(dot.tidy == FALSE){
-dot.coord.rd1 <- merge(dot.coord, box.coord[c("fill", "PANEL", "group", "x")], by = c("PANEL", "group"), sort = FALSE) # rd for random. Send the coord of the boxs into the coord data.frame of the dots (in the column x.y). BEWARE: by = c("PANEL", "group") without fill column because PANEL & group columns are enough as only one value of x column per group number in box.coord. Thus, no need to consider fill column
+dot.coord.rd1 <- merge(dot.coord, box.coord[c("fill", "PANEL", "group", "x")], by = c("PANEL", "group"), sort = FALSE) # rd for random. Send the coord of the boxes into the coord data.frame of the dots (in the column x.y). WARNING: by = c("PANEL", "group") without fill column because PANEL & group columns are enough as only one value of x column per group number in box.coord. Thus, no need to consider fill column
 if(nrow(dot.coord.rd1) != nrow(dot.coord)){
 tempo.cat <- paste0("\n\n================\n\nINTERNAL CODE ERROR IN ", function.name, "\nTHE merge() FUNCTION DID NOT RETURN A CORRECT dot.coord.rd1 DATA FRAME. CODE HAS TO BE MODIFIED\n\n================\n\n")
 stop(tempo.cat)
 }
 set.seed(1)
 sampled.dot.jitter <- if(nrow(dot.coord.rd1) == 1){runif(n = nrow(dot.coord.rd1), min = - dot.jitter / 2, max = dot.jitter / 2)}else{sample(x = runif(n = nrow(dot.coord.rd1), min = - dot.jitter / 2, max = dot.jitter / 2), size = nrow(dot.coord.rd1), replace = FALSE)}
-dot.coord.rd2 <- data.frame(dot.coord.rd1, dot.x = dot.coord.rd1$x.y + sampled.dot.jitter) # set the dot.jitter thanks to runif and dot.jitter range. Then, send the coord of the boxs into the coord data.frame of the dots (in the column x.y)
+dot.coord.rd2 <- data.frame(dot.coord.rd1, dot.x = dot.coord.rd1$x.y + sampled.dot.jitter) # set the dot.jitter thanks to runif and dot.jitter range. Then, send the coord of the boxes into the coord data.frame of the dots (in the column x.y)
 set.seed(NULL)
 if(length(categ) == 1){
 tempo.data1 <- unique(data.frame(data1[categ[1]], group = as.integer(data1[, categ[1]]))) # categ[1] is factor
@@ -9094,7 +9096,7 @@ verif <- c(paste0(categ[1], ".check"), paste0(categ[2], ".check"))
 tempo.cat <- paste0("\n\n============\n\nINTERNAL CODE ERROR IN ", function.name, "\nCODE INCONSISTENCY 6\n\n============\n\n")
 stop(tempo.cat)
 }
-dot.coord.rd3 <- merge(dot.coord.rd2, tempo.data1, by = intersect("group", "group"), sort = FALSE) # send the factors of data1 into coord. BEWARE: I have replaced by = "group" by intersect("group", "group") because of an error due to wrong group group merging in dot.coord.rd3
+dot.coord.rd3 <- merge(dot.coord.rd2, tempo.data1, by = intersect("group", "group"), sort = FALSE) # send the factors of data1 into coord. WARNING: I have replaced by = "group" by intersect("group", "group") because of an error due to wrong group group merging in dot.coord.rd3
 if(nrow(dot.coord.rd3) != nrow(dot.coord) | ( ! fun_comp_2d(dot.coord.rd3[categ], dot.coord.rd3[verif])$identical.content)){
 tempo.cat <- paste0("\n\n================\n\nINTERNAL CODE ERROR IN ", function.name, "\nTHE merge() FUNCTION DID NOT RETURN A CORRECT dot.coord.rd3 DATA FRAME. CODE HAS TO BE MODIFIED\n\n================\n\n")
 stop(tempo.cat)
@@ -9256,7 +9258,7 @@ color = if(is.null(dot.border.color)){dot.coord.rd3$dot.color}else{rep(dot.borde
 fill = dot.coord.rd3$dot.color
 )) # group used in aesthetic to do not have it in the legend. Here ggplot2::scale_discrete_manual() cannot be used because of the group easthetic
 }
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "alpha", name = dot.legend.name, values = rep(dot.alpha,  length(dot.categ.class.order)), guide = ggplot2::guide_legend(override.aes = list(fill = dot.color, color = if(is.null(dot.border.color)){dot.color}else{dot.border.color}, stroke = dot.border.size, alpha = dot.alpha)))) # values are the values of color (which is the border color in geom_box. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "alpha", name = dot.legend.name, values = rep(dot.alpha, length(dot.categ.class.order)), guide = ggplot2::guide_legend(override.aes = list(fill = dot.color, color = if(is.null(dot.border.color)){dot.color}else{dot.border.color}, stroke = dot.border.size, alpha = dot.alpha)))) # values are the values of color (which is the border color in geom_box. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor
 }
 coord.names <- c(coord.names, "dots")
 }else if(dot.tidy == TRUE){
@@ -9265,32 +9267,34 @@ assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geo
 data = dot.coord, 
 mapping = ggplot2::aes_string(x = categ[1], y = "y", group = "group"), # not dot.categ here because the classes of dot.categ create new separations
 position = ggplot2::position_dodge(width = box.width), 
+binpositions = "all", 
 binaxis = "y", 
 stackdir = "center", 
 alpha = dot.alpha, 
 fill = dot.coord$dot.color, 
 stroke = dot.border.size, 
 color = if(is.null(dot.border.color)){dot.coord$dot.color}else{rep(dot.border.color, nrow(dot.coord))}, 
-show.legend = FALSE, # BEWARE: do not use show.legend = TRUE because it uses the arguments outside aes() as aesthetics (here color and fill). Thus I must find a way using ggplot2::scale_discrete_manual()
+show.legend = FALSE, # WARNING: do not use show.legend = TRUE because it uses the arguments outside aes() as aesthetics (here color and fill). Thus I must find a way using ggplot2::scale_discrete_manual()
 binwidth = (y.lim[2] - y.lim[1]) / dot.tidy.bin.nb
-)) # geom_dotplot ggplot2 v3.3.0: I had to remove rev() in fill and color # very weird behavior of geom_dotplot ggplot2 v3.2.1, (1) because with aes group = (to avoid legend), the dot plotting is not good in term of coordinates, and (2) because data1 seems reorderer according to x = categ[1] before plotting. Thus, I have  to use fill = dot.coord[rev(order(dot.coord[, categ[1]], decreasing = TRUE)), "dot.color"] to have the good corresponding colors # show.legend option do not remove the legend, only the aesthetic of the legend (dot, line, etc.)
+)) # geom_dotplot ggplot2 v3.3.0: I had to remove rev() in fill and color # very weird behavior of geom_dotplot ggplot2 v3.2.1, (1) because with aes group = (to avoid legend), the dot plotting is not good in term of coordinates, and (2) because data1 seems reorderer according to x = categ[1] before plotting. Thus, I have to use fill = dot.coord[rev(order(dot.coord[, categ[1]], decreasing = TRUE)), "dot.color"] to have the good corresponding colors # show.legend option do not remove the legend, only the aesthetic of the legend (dot, line, etc.)
 coord.names <- c(coord.names, "dots")
 if( ! is.null(dot.categ)){
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_dotplot(
 data = dot.coord, 
 mapping = ggplot2::aes_string(x = categ[1], y = "y", alpha = dot.categ), # not dot.categ here because the classes of dot.categ create new separations
 position = ggplot2::position_dodge(width = box.width), 
+binpositions = "all", 
 binaxis = "y", 
 stackdir = "center", 
 fill = NA, 
 stroke = NA, 
 color = NA, 
-# BEWARE: do not use show.legend =  TRUE because it uses the arguments outside aes() as aesthetics (here color and fill). Thus I must find a way using ggplot2::scale_discrete_manual()
+# WARNING: do not use show.legend = TRUE because it uses the arguments outside aes() as aesthetics (here color and fill). Thus I must find a way using ggplot2::scale_discrete_manual()
 binwidth = (y.lim[2] - y.lim[1]) / dot.tidy.bin.nb
-)) # geom_dotplot ggplot2 v3.3.0: I had to remove rev() in fill and color # very weird behavior of geom_dotplot ggplot2 v3.2.1, (1) because with aes group = (to avoid legend), the dot plotting is not good in term of coordinates, and (2) because data1 seems reorderer according to x = categ[1] before plotting. Thus, I have  to use fill = dot.coord[rev(order(dot.coord[, categ[1]], decreasing = TRUE)), "dot.color"] to have the good corresponding colors # show.legend option do not remove the legend, only the aesthetic of the legend (dot, line, etc.)
-# assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "linetype", name = dot.legend.name, values = rep(1, length(categ.color)))) # values = rep("black", length(categ.color)) are the values of color (which is the border color of dots), and this modify the border color on the plot. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor
+)) # geom_dotplot ggplot2 v3.3.0: I had to remove rev() in fill and color # very weird behavior of geom_dotplot ggplot2 v3.2.1, (1) because with aes group = (to avoid legend), the dot plotting is not good in term of coordinates, and (2) because data1 seems reorderer according to x = categ[1] before plotting. Thus, I have to use fill = dot.coord[rev(order(dot.coord[, categ[1]], decreasing = TRUE)), "dot.color"] to have the good corresponding colors # show.legend option do not remove the legend, only the aesthetic of the legend (dot, line, etc.)
+# assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "linetype", name = dot.legend.name, values = rep(1, length(categ.color)))) # values = rep("black", length(categ.color)) are the values of color (which is the border color of dots), and this modify the border color on the plot. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor
 coord.names <- c(coord.names, "bad_remove")
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "alpha", name = dot.legend.name, values = rep(dot.alpha,  length(dot.categ.class.order)), labels = dot.categ.class.order, guide = ggplot2::guide_legend(title = if(ini.dot.categ == categ[length(categ)]){dot.categ}else{ini.dot.categ}, override.aes = list(fill = levels(dot.coord$dot.color), color = if(is.null(dot.border.color)){levels(dot.coord$dot.color)}else{dot.border.color}, stroke = dot.border.size, alpha = dot.alpha)))) # values are the values of color (which is the border color in geom_box. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "alpha", name = dot.legend.name, values = rep(dot.alpha, length(dot.categ.class.order)), labels = dot.categ.class.order, guide = ggplot2::guide_legend(title = if(ini.dot.categ == categ[length(categ)]){dot.categ}else{ini.dot.categ}, override.aes = list(fill = levels(dot.coord$dot.color), color = if(is.null(dot.border.color)){levels(dot.coord$dot.color)}else{dot.border.color}, stroke = dot.border.size, alpha = dot.alpha)))) # values are the values of color (which is the border color in geom_box. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor
 }
 # coordinates of tidy dots
 tempo.coord <- ggplot2::ggplot_build(eval(parse(text = paste(paste0(tempo.gg.name, 1:tempo.gg.count), collapse = " + "))))$data # to have the tidy dot coordinates
@@ -9300,18 +9304,18 @@ stop(tempo.cat)
 }else{
 dot.coord.tidy1 <- tempo.coord[[which(sapply(tempo.coord, FUN = nrow) == nrow(data1))[1]]] # the second being a blank dotplot with wrong coordinates. Thus take the first whatever situation
 }
-tempo.box.coord <- merge(box.coord, unique(dot.coord[, c("PANEL", "group", categ)]), by = c("PANEL", "group"), sort = FALSE) # do not add dot.categ and tidy_group_coord here because the coordinates are for stats. Add the categ in box.coord. BEWARE: by = c("PANEL", "group") without fill column because PANEL & group columns are enough as only one value of x column per group number in box.coord. Thus, no need to consider fill column
+tempo.box.coord <- merge(box.coord, unique(dot.coord[, c("PANEL", "group", categ)]), by = c("PANEL", "group"), sort = FALSE) # do not add dot.categ and tidy_group_coord here because the coordinates are for stats. Add the categ in box.coord. WARNING: by = c("PANEL", "group") without fill column because PANEL & group columns are enough as only one value of x column per group number in box.coord. Thus, no need to consider fill column
 # below inactivated because not true when dealing with dot.categ different from categ
 if(nrow(tempo.box.coord) != nrow(box.coord)){
 tempo.cat <- paste0("\n\n================\n\nINTERNAL CODE ERROR IN ", function.name, "\nTHE merge() FUNCTION DID NOT RETURN A CORRECT tempo.box.coord DATA FRAME. CODE HAS TO BE MODIFIED\n\n================\n\n")
 stop(tempo.cat)
 }
-dot.coord.tidy2 <- merge(dot.coord.tidy1, tempo.box.coord[c("fill", "PANEL", "group", "x", categ)], by = c("PANEL", "group"), sort = FALSE) # send the coord of the boxs into the coord data.frame of the dots (in the column x.y).BEWARE: by = c("PANEL", "group") without fill column because PANEL & group columns are enough as only one value of x column per group number in tempo.box.coord. Thus, no need to consider fill colum # DANGER: from here the fill.y and x.y (from tempo.box.coord) are not good in dot.coord.tidy2. It is ok because Group1 Group2 from tempo.box.coord are ok with the group column from dot.coord.tidy1. This is due to the fact that dot.coord.tidy resulting from geom_dotplot does not make the same groups as the other functions
+dot.coord.tidy2 <- merge(dot.coord.tidy1, tempo.box.coord[c("fill", "PANEL", "group", "x", categ)], by = c("PANEL", "group"), sort = FALSE) # send the coord of the boxes into the coord data.frame of the dots (in the column x.y).WARNING: by = c("PANEL", "group") without fill column because PANEL & group columns are enough as only one value of x column per group number in tempo.box.coord. Thus, no need to consider fill colum # DANGER: from here the fill.y and x.y (from tempo.box.coord) are not good in dot.coord.tidy2. It is ok because Group1 Group2 from tempo.box.coord are ok with the group column from dot.coord.tidy1. This is due to the fact that dot.coord.tidy resulting from geom_dotplot does not make the same groups as the other functions
 if(nrow(dot.coord.tidy2) != nrow(dot.coord)){
 tempo.cat <- paste0("\n\n================\n\nINTERNAL CODE ERROR IN ", function.name, "\nTHE merge() FUNCTION DID NOT RETURN A CORRECT dot.coord.tidy2 DATA FRAME. CODE HAS TO BE MODIFIED\n\n================\n\n")
 stop(tempo.cat)
 }
-# From here, check for dot.coord.tidy3 which wil be important for stat over the plot. BEWARE: dot.categ has nothing to do here for stat coordinates. Thus, not in tempo.data1
+# From here, check for dot.coord.tidy3 which wil be important for stat over the plot. WARNING: dot.categ has nothing to do here for stat coordinates. Thus, not in tempo.data1
 if(length(categ) == 1){
 tempo.data1 <- unique(data.frame(data1[categ[1]], group = as.integer(data1[, categ[1]]))) # categ[1] is factor
 names(tempo.data1)[names(tempo.data1) == categ[1]] <- paste0(categ[1], ".check")
@@ -9334,7 +9338,7 @@ verif <- c(paste0(categ[1], ".check"), paste0(categ[2], ".check"))
 tempo.cat <- paste0("\n\n============\n\nINTERNAL CODE ERROR IN ", function.name, "\nCODE INCONSISTENCY 7\n\n============\n\n")
 stop(tempo.cat)
 }
-dot.coord.tidy3 <- merge(dot.coord.tidy2, tempo.data1, by = intersect("group", "group"), sort = FALSE) # send the factors of data1 into coord. BEWARE: I have tested intersect("group", "group") instead of by = "group". May be come back to by = "group"  in case of error. But I did this because of an error in dot.coord.rd3 above
+dot.coord.tidy3 <- merge(dot.coord.tidy2, tempo.data1, by = intersect("group", "group"), sort = FALSE) # send the factors of data1 into coord. WARNING: I have tested intersect("group", "group") instead of by = "group". May be come back to by = "group" in case of error. But I did this because of an error in dot.coord.rd3 above
 if(nrow(dot.coord.tidy3) != nrow(dot.coord) | ( ! fun_comp_2d(dot.coord.tidy3[categ], dot.coord.tidy3[verif])$identical.content)){
 tempo.cat <- paste0("\n\n================\n\nINTERNAL CODE ERROR IN ", function.name, "\nTHE merge() FUNCTION DID NOT RETURN A CORRECT dot.coord.tidy3 DATA FRAME. CODE HAS TO BE MODIFIED\n\n================\n\n")
 stop(tempo.cat)
@@ -9348,8 +9352,8 @@ stop(tempo.cat)
 
 # boxplot display (if box.fill = FALSE, otherwise, already plotted above)
 if(box.fill == TRUE){
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values =  if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[length(categ)]])))}else{categ.color})) #, guide = ggplot2::guide_legend(override.aes = list(fill = levels(tempo.polygon$COLOR), color = "black")))) # values are the values of color (which is the border color in geom_box. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "color", name = box.legend.name, values = rep(hsv(0, 0, 0, alpha = box.alpha), length(unique(data1[, categ[length(categ)]]))))) # , guide = ggplot2::guide_legend(override.aes = list(color = "black", alpha = box.alpha)))) # values are the values of color (which is the border color in geom_box. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor # outline of the polygon in black but with alpha
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values = if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[length(categ)]])))}else{categ.color})) #, guide = ggplot2::guide_legend(override.aes = list(fill = levels(tempo.polygon$COLOR), color = "black")))) # values are the values of color (which is the border color in geom_box. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "color", name = box.legend.name, values = rep(hsv(0, 0, 0, alpha = box.alpha), length(unique(data1[, categ[length(categ)]]))))) # , guide = ggplot2::guide_legend(override.aes = list(color = "black", alpha = box.alpha)))) # values are the values of color (which is the border color in geom_box. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor # outline of the polygon in black but with alpha
 }else{
 # assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_boxplot(data = data1, mapping = ggplot2::aes_string(x = categ[1], y = y, color = categ[length(categ)], fill = categ[length(categ)]), position = ggplot2::position_dodge(width = NULL), width = box.width, size = box.line.size, notch = box.notch, alpha = box.alpha, coef = if(box.whisker.kind == "no"){0}else if(box.whisker.kind == "std"){1.5}else if(box.whisker.kind == "max"){Inf}, outlier.shape = if( ! is.null(dot.color)){NA}else{21}, outlier.color = if( ! is.null(dot.color)){NA}else{if(dot.border.size == 0){NA}else{dot.border.color}}, outlier.fill = if( ! is.null(dot.color)){NA}else{NULL}, outlier.size = if( ! is.null(dot.color)){NA}else{dot.size}, outlier.stroke = if( ! is.null(dot.color)){NA}else{dot.border.size}, outlier.alpha = if( ! is.null(dot.color)){NA}else{dot.alpha})) # the color, size, etc. of the outliers are dealt here. outlier.color = NA to do not plot outliers when dots are already plotted
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::geom_path(
@@ -9386,8 +9390,8 @@ linejoin = "round"
 ))
 coord.names <- c(coord.names, "mean")
 }
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values = rep(NA, length(unique(data1[, categ[length(categ)]]))))) #, guide = ggplot2::guide_legend(override.aes = list(color = categ.color)))) # values are the values of color (which is the border color in geom_box. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "color", name = box.legend.name, values = if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[length(categ)]])))}else{categ.color}, guide = ggplot2::guide_legend(override.aes = list(alpha = if(plot == TRUE & ((length(dev.list()) > 0 & names(dev.cur()) == "windows") | (length(dev.list()) == 0 & Sys.info()["sysname"] == "Windows"))){1}else{box.alpha})))) # , guide = ggplot2::guide_legend(override.aes = list(color = as.character(categ.color))))) # values are the values of color (which is the border color in geom_box. BEWARE: values = categ.color takes the numbers to make the colors if categ.color is a factor
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "fill", name = box.legend.name, values = rep(NA, length(unique(data1[, categ[length(categ)]]))))) #, guide = ggplot2::guide_legend(override.aes = list(color = categ.color)))) # values are the values of color (which is the border color in geom_box. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_discrete_manual(aesthetics = "color", name = box.legend.name, values = if(length(categ.color) == 1){rep(categ.color, length(unique(data1[, categ[length(categ)]])))}else{categ.color}, guide = ggplot2::guide_legend(override.aes = list(alpha = if(plot == TRUE & ((length(dev.list()) > 0 & names(dev.cur()) == "windows") | (length(dev.list()) == 0 & Sys.info()["sysname"] == "Windows"))){1}else{box.alpha})))) # , guide = ggplot2::guide_legend(override.aes = list(color = as.character(categ.color))))) # values are the values of color (which is the border color in geom_box. WARNING: values = categ.color takes the numbers to make the colors if categ.color is a factor
 if(plot == TRUE & ((length(dev.list()) > 0 & names(dev.cur()) == "windows") | (length(dev.list()) == 0 & Sys.info()["sysname"] == "Windows"))){ # if any Graph device already open and this device is "windows", or if no Graph device opened yet and we are on windows system -> prevention of alpha legend bug on windows using value 1
 # to avoid a bug on windows: if alpha argument is different from 1 for lines (transparency), then lines are not correctly displayed in the legend when using the R GUI (bug https://github.com/tidyverse/ggplot2/issues/2452). No bug when using a pdf
 warn.count <- warn.count + 1
@@ -9404,7 +9408,7 @@ warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn
 # layer after dots but ok, behind dots on the plot
 if( ! is.null(stat.disp)){
 if(stat.disp == "top"){
-assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1),  ggplot2::annotate(geom = "text", x = stat$X, y = y.lim[2], label = if(stat.disp.mean == FALSE){fun_round(stat$MEDIAN, 2)}else{fun_round(stat$MEAN, 2)}, size = stat.size, color = "black", hjust = ifelse(vertical == TRUE, 0.5, 1.1), vjust = ifelse(vertical == TRUE, 1.1, 0.5))) # beware: no need of order() for labels because box.coord$x set the order. For justification, see https://stackoverflow.com/questions/7263849/what-do-hjust-and-vjust-do-when-making-a-plot-using-ggplot
+assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::annotate(geom = "text", x = stat$X, y = y.lim[2], label = if(stat.disp.mean == FALSE){fun_round(stat$MEDIAN, 2)}else{fun_round(stat$MEAN, 2)}, size = stat.size, color = "black", hjust = ifelse(vertical == TRUE, 0.5, 1.1), vjust = ifelse(vertical == TRUE, 1.1, 0.5))) # WARNING: no need of order() for labels because box.coord$x set the order. For justification, see https://stackoverflow.com/questions/7263849/what-do-hjust-and-vjust-do-when-making-a-plot-using-ggplot
 coord.names <- c(coord.names, "stat.display")
 }else if(stat.disp == "above"){
 # stat coordinates
@@ -9420,7 +9424,7 @@ names(stat.coord1)[names(stat.coord1) == "y"] <- "dot.min"
 stat.coord2 <- aggregate(x = tempo.stat.ini["y"], by = {x.env <- if(length(categ) == 1){list(tempo.stat.ini$group, tempo.stat.ini$x.y, tempo.stat.ini[, categ[1]])}else if(length(categ) == 2){list(tempo.stat.ini$group, tempo.stat.ini$x.y, tempo.stat.ini[, categ[1]], tempo.stat.ini[, categ[2]])} ; names(x.env) <- if(length(categ) == 1){c("group", "x.y", categ[1])}else if(length(categ) == 2){c("group", "x.y", categ[1], categ[2])} ; x.env}, FUN = max, na.rm = TRUE)
 names(stat.coord2) <- paste0(names(stat.coord2), "_from.dot.max")
 names(stat.coord2)[names(stat.coord2) == "y_from.dot.max"] <- "dot.max"
-stat.coord3 <- cbind(box.coord[order(box.coord$x), ], stat.coord1[order(stat.coord1$x.y), ], stat.coord2[order(stat.coord2$x.y), ]) # should be ok to use box.coord$x and stat.coord$x.y to assemble the two data frames because x coordinates of the boxs. Thus, we cannot have identical values
+stat.coord3 <- cbind(box.coord[order(box.coord$x), ], stat.coord1[order(stat.coord1$x.y), ], stat.coord2[order(stat.coord2$x.y), ]) # should be ok to use box.coord$x and stat.coord$x.y to assemble the two data frames because x coordinates of the boxes. Thus, we cannot have identical values
 if( ! all(identical(round(stat.coord3$x, 9), round(stat.coord3$x.y, 9)))){
 tempo.cat <- paste0("\n\n================\n\nINTERNAL CODE ERROR IN ", function.name, "\nFUSION OF box.coord, stat.coord1 AND stat.coord2 ACCORDING TO box.coord$x, stat.coord1$x.y AND stat.coord2$x.y IS NOT CORRECT. CODE HAS TO BE MODIFIED\n\n================\n\n")
 stop(tempo.cat)
@@ -9429,7 +9433,7 @@ text.coord <- stat.coord3[, c("x", "group", "dot.min", "dot.max")]
 names(text.coord)[names(text.coord) == "dot.min"] <- "text.min.pos"
 names(text.coord)[names(text.coord) == "dot.max"] <- "text.max.pos"
 box.coord <- box.coord[order(box.coord$x), ]
-text.coord <- text.coord[order(text.coord$x), ] # to be sure to have the two objects in the same order for x. BEWARE: cannot add identical(as.integer(text.coord$group), as.integer(box.coord$group)) because with error, the correspondence between x and group is not the same
+text.coord <- text.coord[order(text.coord$x), ] # to be sure to have the two objects in the same order for x. WARNING: cannot add identical(as.integer(text.coord$group), as.integer(box.coord$group)) because with error, the correspondence between x and group is not the same
 if( ! identical(text.coord$x, box.coord$x)){
 tempo.cat <- paste0("\n\n============\n\nINTERNAL CODE ERROR IN ", function.name, "\ntext.coord AND box.coord DO NOT HAVE THE SAME x COLUMN CONTENT\n\n============\n\n")
 stop(tempo.cat)
@@ -9448,27 +9452,27 @@ tempo.log.low <- if(diff(y.lim) > 0){box.coord$MEAN < 0}else{box.coord$MEAN >= 0
 if(any(tempo.log.high) == TRUE){
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::annotate(
 geom = "text", 
-x = get(if(is.null(dot.color)){"box.coord"}else{"text.coord"})$x[tempo.log.high], # get(if(is.null(dot.color)){"box.coord"}else{"text.coord"}) for text just above error boxs or dots
+x = get(if(is.null(dot.color)){"box.coord"}else{"text.coord"})$x[tempo.log.high], # get(if(is.null(dot.color)){"box.coord"}else{"text.coord"}) for text just above error boxes or dots
 y = get(if(is.null(dot.color)){"box.coord"}else{"text.coord"})[tempo.log.high, if(is.null(dot.color)){"middle"}else{"text.max.pos"}], 
 label = if(stat.disp.mean == FALSE){fun_round(box.coord$middle, 2)[tempo.log.high]}else{fun_round(box.coord$MEAN, 2)[tempo.log.high]}, 
 size = stat.size, 
 color = "black", 
 hjust = ifelse(vertical == TRUE, 0.5, 0.5 - stat.dist), 
 vjust = ifelse(vertical == TRUE, 0.5 - stat.dist, 0.5)
-)) # beware: no need of order() for labels because box.coord$x set the order
+)) # WARNING: no need of order() for labels because box.coord$x set the order
 coord.names <- c(coord.names, "stat.display.positive")
 }
 if(any(tempo.log.low) == TRUE){
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::annotate(
 geom = "text", 
-x = get(if(is.null(dot.color)){"box.coord"}else{"text.coord"})$x[tempo.log.low], # get(if(is.null(dot.color)){"box.coord"}else{"text.coord"}) for text just above error boxs or dots
+x = get(if(is.null(dot.color)){"box.coord"}else{"text.coord"})$x[tempo.log.low], # get(if(is.null(dot.color)){"box.coord"}else{"text.coord"}) for text just above error boxes or dots
 y = get(if(is.null(dot.color)){"box.coord"}else{"text.coord"})[tempo.log.low, if(is.null(dot.color)){"middle"}else{"text.min.pos"}], 
 label = if(stat.disp.mean == FALSE){fun_round(box.coord$middle, 2)[tempo.log.low]}else{fun_round(box.coord$MEAN, 2)[tempo.log.low]}, 
 size = stat.size, 
 color = "black", 
 hjust = ifelse(vertical == TRUE, 0.5, 0.5 + stat.dist), 
 vjust = ifelse(vertical == TRUE, 0.5 + stat.dist, 0.5)
-)) # beware: no need of order() for labels because box.coord$x set the order
+)) # WARNING: no need of order() for labels because box.coord$x set the order
 coord.names <- c(coord.names, "stat.display.negative")
 }
 # end stat display
@@ -9513,7 +9517,7 @@ y.second.tick.values <- tempo$values
 y.second.tick.pos <- tempo$coordinates
 # if(vertical == TRUE){ # do not remove in case the bug is fixed
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::annotate(geom = "segment", y = y.second.tick.pos, yend = y.second.tick.pos, x = tempo.coord$x.range[1], xend = tempo.coord$x.range[1] + diff(tempo.coord$x.range) / 80))
-# }else{ # not working because  of the ggplot2 bug
+# }else{ # not working because of the ggplot2 bug
 # assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::annotate(geom = "segment", x = y.second.tick.pos, xend = y.second.tick.pos, y = tempo.coord$y.range[1], yend = tempo.coord$y.range[1] + diff(tempo.coord$y.range) / 80))
 # }
 coord.names <- c(coord.names, "y.second.tick.positions")
@@ -9536,7 +9540,7 @@ coord.names <- c(coord.names, "y.second.tick.positions")
 assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_y_continuous(
 breaks = tempo.scale, 
 minor_breaks = y.second.tick.pos, 
-labels = if(y.log == "log10"){scales::trans_format("identity", scales::math_format(10^.x))}else if(y.log == "log2"){scales::trans_format("identity",  scales::math_format(2^.x))}else if(y.log == "no"){ggplot2::waiver()}else{tempo.cat <- paste0("\n\n============\n\nINTERNAL CODE ERROR IN ", function.name, "\nCODE INCONSISTENCY 10\n\n============\n\n") ; stop(tempo.cat)}, 
+labels = if(y.log == "log10"){scales::trans_format("identity", scales::math_format(10^.x))}else if(y.log == "log2"){scales::trans_format("identity", scales::math_format(2^.x))}else if(y.log == "no"){ggplot2::waiver()}else{tempo.cat <- paste0("\n\n============\n\nINTERNAL CODE ERROR IN ", function.name, "\nCODE INCONSISTENCY 10\n\n============\n\n") ; stop(tempo.cat)}, 
 expand = c(0, 0), # remove space after after axis limits
 limits = sort(y.lim), # NA indicate that limits must correspond to data limits but ylim() already used
 oob = scales::rescale_none, 
@@ -9651,6 +9655,9 @@ return(output) # this plots the graph if return.ggplot is TRUE and if no assignm
 
 
 
+
+
+
 fun_gg_scatter <- function(
 data1, 
 x, 
diff --git a/fun_gg_boxplot.docx b/fun_gg_boxplot.docx
index ecd8b5a935e5a6ca6f324eca773ffd6135d90035..440fdacfe95813c01f8103801da877f2a5c4b3ee 100644
Binary files a/fun_gg_boxplot.docx and b/fun_gg_boxplot.docx differ