Commit 538da721 authored by Gael  MILLOT's avatar Gael MILLOT
Browse files

fun_gg_boxplot() color with tidy and dot.categ.class.order seem fixed, remain...

fun_gg_boxplot() color with tidy and dot.categ.class.order seem fixed, remain y.tick.nb to solve, because of ggplot::ylim() that redraw breaks
parent c734f439
......@@ -2,7 +2,7 @@
### 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")), categ.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")), categ.legend.name = "LEGEND", categ.color = NULL, box.width = 0.8, dot.color = "grey50", 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)
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")), categ.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)) ;
fun_gg_boxplot(data1 = obs1, y = "Time", categ = "Group1")
......@@ -114,3 +114,6 @@ obs1 <- data.frame(x = 1:20, Group1 = rep(c("G", "H"), times = 10), Group2 = rep
obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200)) ; a <- fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 100, return = TRUE, dot.categ = "Group2", dot.categ.class.order=c("B", "D", "E", "A", "C")) # error with dot.categ.class.order
obs1 <- data.frame(Time = 1:1000, Group1 = rep(c("G", "H"), times = 500), Group2 = rep(LETTERS[1:5], each = 200)) ; a <- fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = "same", dot.tidy = TRUE, dot.tidy.bin.nb = 100, return = TRUE, dot.categ = "Group2", dot.categ.class.order=c("A", "B", "C", "D", "E")) # error with dot.categ.class.order
set.seed(1) ; obs1 <- data.frame(Time = c(sort(rnorm(10)), sort(rnorm(10)) + 2), Group1 = rep(c("G", "H"), each = 10), Group2 = rep(c("A", "B"), time = 10), Group3 = rep(c("I", "J", "K", "L"), time = 5)) ; set.seed(NULL) ; obs1 ; # obs1$Time[1:10] <- NA ;
a <- fun_gg_boxplot(data1 = obs1, y = "Time", categ = c("Group1", "Group2"), dot.color = 1:4, dot.tidy = FALSE, dot.tidy.bin.nb = 100, return = TRUE, dot.categ = "Group3") # error with dot.categ.class.order
\ No newline at end of file
This diff is collapsed.
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment