From 5ba00b9c55ea22c5d8e208fc3a7932522800cba7 Mon Sep 17 00:00:00 2001
From: gmillot <gael.millot@pasteur.fr>
Date: Fri, 15 Dec 2023 19:26:47 +0100
Subject: [PATCH] release v12.8: Warning: functions relatives to the cute/trust
 packages have been removed -> correct only the cute_little_R_functions.R file
 if necessary | bug fixed in fun_gg_donut about palette and color

---
 README.md                 | 6 ++++++
 cute_little_R_functions.R | 3 ++-
 examples_fun_gg_donut.R   | 2 +-
 fun_gg_donut.R            | 3 ++-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 7261744..76d3c7e 100755
--- a/README.md
+++ b/README.md
@@ -118,6 +118,12 @@ Gitlab developers
 
 ## WHAT'S NEW IN
 
+### v12.8.0
+
+- Warning: functions relatives to the cute/trust packages have been removed -> correct only the cute_little_R_functions.R file if necessary
+- bug fixed in fun_gg_donut about palette and color
+
+
 ### v12.7.0
 
 - bug fixed for the arg.check object inside all the functions
diff --git a/cute_little_R_functions.R b/cute_little_R_functions.R
index 7f87f5d..c4204fd 100755
--- a/cute_little_R_functions.R
+++ b/cute_little_R_functions.R
@@ -14425,7 +14425,8 @@ fun_gg_donut <- function(
         assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_fill_brewer(palette = fill.palette, name = legend.name))
     }else if( ! is.null(fill.color)){
         assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_fill_manual(values = fill.color, name = legend.name, na.value = "white"))
-    }else if( ! is.null(legend.name)){
+    }
+    if(legend.name != ""){
         assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::labs(fill = legend.name)) # title of the legend
     }
     
diff --git a/examples_fun_gg_donut.R b/examples_fun_gg_donut.R
index c7a2652..39f7221 100644
--- a/examples_fun_gg_donut.R
+++ b/examples_fun_gg_donut.R
@@ -35,7 +35,7 @@ fun_gg_donut(data1 = obs1, freq = "Km", categ = "Car",
 
 # The fill.color argument overrides the fill.palette argument
 fun_gg_donut(data1 = obs1, freq = "Km", categ = "Car",
-    fill.palette = "BrBG",
+    fill.palette = "Spectral",
     fill.color = obs1$Color1
 )
 # Using the fill.color argument (as elements from colors())
diff --git a/fun_gg_donut.R b/fun_gg_donut.R
index 71d3688..cb0e97e 100644
--- a/fun_gg_donut.R
+++ b/fun_gg_donut.R
@@ -594,7 +594,8 @@ fun_gg_donut <- function(
         assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_fill_brewer(palette = fill.palette, name = legend.name))
     }else if( ! is.null(fill.color)){
         assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::scale_fill_manual(values = fill.color, name = legend.name, na.value = "white"))
-    }else if( ! is.null(legend.name)){
+    }
+    if(legend.name != ""){
         assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::labs(fill = legend.name)) # title of the legend
     }
 
-- 
GitLab