diff --git a/README.md b/README.md
index ff062703dc2178a802ce0cb4106e97a1d8c1832c..d9bb97fdc25ee8bea8e361402d4c6fefccff2601 100644
--- a/README.md
+++ b/README.md
@@ -170,6 +170,15 @@ Gitlab developers
 
 ## WHAT'S NEW IN
 
+### v10.8.0
+
+1) fun_check() and fun_info() removed from this repo and transferred into the cute package
+
+2) Warning: fun_check() must be conveted into cute::check() in all the functions of this repo
+
+3) Warning: fun_info() must be conveted into cute::info() in all the functions of this repo
+
+
 ### v10.7.0
 
 1) fun_gg_boxplot : name of arguments stat.disp and stat.disp.mean changed to stat.pos and stat.mean
diff --git a/cute_little_R_functions.R b/cute_little_R_functions.R
index ec97cc20a8099336d585e1b31267ecdcb05940cc..0bdfeca05d5d09fccb7802778edd2369ae5c4c6f 100644
--- a/cute_little_R_functions.R
+++ b/cute_little_R_functions.R
@@ -8,11 +8,21 @@
 ################################################################
 
 
+###### INFO
+
 # color palette: see https://github.com/EmilHvitfeldt/r-color-palettes
 # https://usethis.r-lib.org/ and usethat also
 # ERROR: this line tempo.log <- suppressWarnings(sapply(lapply(lapply(tempo.arg, FUN = get, env = sys.nframe(), inherit = FALSE), FUN = is.na), FUN = any)) & lapply(lapply(tempo.arg, FUN = get, env = sys.nframe(), inherit = FALSE), FUN = length) == 1L does not work if no argument provided. Example fun_secu(). Fix it everywhere
+# change everywhere: if( ! is.null(arg.check)){
+# For heatmap: see https://bioinfo-fr.net/creer-des-heatmaps-a-partir-de-grosses-matrices-en-r
+
+# New function: fun_pdf_conc for Rosine code?
+# https://stackoverflow.com/questions/17552917/merging-existing-pdf-files-using-r
+# https://www.r-bloggers.com/2019/04/join-split-and-compress-pdf-files-with-pdftools/
+# https://rdrr.io/cran/staplr/man/staple_pdf.html
 
-## LAST ROUND OF FORMATTING:
+
+###### LAST ROUND OF FORMATTING
 # 1) Arguments: one per line
 # 2) Description:
 # first capital letter everywhere
@@ -87,28 +97,14 @@
 # example sheet OK 
 # check all and any OK
 # -> clear to go Apollo
+# -> transferred into the cute package
+# 9) transfer the clean function into the cute repo
 
+###### WARNING:
+# 1) do not forget to remove all the fun_ in the cute repo
+# 2) call the cute package before the cute_little_r_toolbow, because some functions are now only in the cute package
 
 
-# package: 
-# Templates: https://prettydoc.statr.me/themes.html
-# http://r-pkgs.had.co.nz/
-# https://pkgdown.r-lib.org/
-# https://rdrr.io/github/gastonstat/cointoss/
-# doc:https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html considering that https://www.ericholscher.com/blog/2014/feb/11/sphinx-isnt-just-for-python/
-# https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html
-# https://docs.gitlab.com/ee/user/project/pages/
-# also register into biotools
-
-# change everywhere: if( ! is.null(arg.check)){
-
-# For heatmap: see https://bioinfo-fr.net/creer-des-heatmaps-a-partir-de-grosses-matrices-en-r
-
-# New function: fun_pdf_conc for Rosine code?
-# https://stackoverflow.com/questions/17552917/merging-existing-pdf-files-using-r
-# https://www.r-bloggers.com/2019/04/join-split-and-compress-pdf-files-with-pdftools/
-# https://rdrr.io/cran/staplr/man/staple_pdf.html
-
 ################################ OUTLINE ################################
 
 
@@ -180,424 +176,8 @@
 # example sheet OK 
 # check all and any OK
 # -> clear to go Apollo
-fun_check <- function(
-data, 
-class = NULL, 
-typeof = NULL, 
-mode = NULL, 
-length = NULL, 
-prop = FALSE, 
-double.as.integer.allowed = FALSE, 
-options = NULL, 
-all.options.in.data = FALSE, 
-na.contain = FALSE, 
-neg.values = TRUE, 
-print = FALSE, 
-data.name = NULL, 
-fun.name = NULL
-){
-# AIM
-# Check the class, type, mode and length of the data argument
-# Mainly used to check the arguments of other functions
-# Check also other kind of data parameters, is it a proportion? Is it type double but numbers without decimal part?
-# If options == NULL, then at least class or type or mode or length argument must be non-null
-# If options is non-null, then class, type and mode must be NULL, and length can be NULL or specified
-# WARNINGS
-# The function tests what is written in its arguments, even if what is written is incoherent. For instance, fun_check(data = factor(1), class = "factor", mode = "character") will return a problem, whatever the object tested in the data argument, because no object can be class "factor" and mode "character" (factors are class "factor" and mode "numeric"). Of note, length of object of class "environment" is always 0
-# If the tested object is NULL, then the function will always return a checking problem
-# Since R >= 4.0.0, class(matrix()) returns "matrix" "array", and not "matrix" alone as before. However, use argument class = "matrix" to check for matrix object (of class "matrix" "array" in R >= 4.0.0) and use argument class = "array" to check for array object (of class "array" in R >= 4.0.0)
-# ARGUMENTS
-# data: object to test
-# class: character string. Either one of the class() result (But see the warning section above) or "vector" or "ggplot2" (i.e., objects of class c("gg", "ggplot")) or NULL
-# typeof: character string. Either one of the typeof() result or NULL
-# mode: character string. Either one of the mode() result (for non-vector object) or NULL
-# length: numeric value indicating the length of the object. Not considered if NULL
-# prop: logical. Are the numeric values between 0 and 1 (proportion)? If TRUE, can be used alone, without considering class, etc.
-# double.as.integer.allowed: logical. If TRUE, no error is reported in the cheking message if argument is set to typeof == "integer" or class == "integer", while the reality is typeof == "double" or class == "numeric" but the numbers strictly have zero as modulo (remainder of a division). This means that i <- 1, which is typeof(i) -> "double" is considered as integer with double.as.integer.allowed = TRUE. WARNING: data%%1 == 0L but not isTRUE(all.equal(data%%1, 0)) is used here because the argument checks for integers stored as double (does not check for decimal numbers that are approximate integers)
-# options: a vector of character strings or integers indicating all the possible option values for the data argument, or NULL. Numbers of type "double" are accepted if they have a 0 modulo
-# all.options.in.data: logical. If TRUE, all of the options must be present at least once in the data argument, and nothing else. If FALSE, some or all of the options must be present in the data argument, and nothing else. Ignored if options is NULL
-# na.contain: logical. Can the data argument contain NA?
-# neg.values: logical. Are negative numeric values authorized? Warning: the default setting is TRUE, meaning that, in that case, no check is performed for the presence of negative values. The neg.values argument is activated only when set to FALSE. In addition, (1) neg.values = FALSE can only be used when class, typeof or mode arguments are not NULL, otherwise return an error message, (2) the presence of negative values is not checked with neg.values = FALSE if the tested object is a factor and the following checking message is returned "OBJECT MUST BE MADE OF NON NEGATIVE VALUES BUT IS A FACTOR"
-# print: logical. Print the message if $problem is TRUE? Warning: set by default to FALSE, which facilitates the control of the checking message output when using fun_check() inside functions. See the example section
-# data.name: character string indicating the name of the object to test. If NULL, use what is assigned to the data argument for the returned message
-# fun.name: character string indicating the name of the function checked (i.e., when fun_check() is used to check the arguments of this function). If non-null, the value of fun.name will be added into the message returned by fun_check()
-# RETURN
-# A list containing:
-# $problem: logical. Is there any problem detected?
-# $text: message indicating the details of the problem, or the absence of problem
-# $object.name: value of the data.name argument (i.e., name of the checked object if provided, NULL otherwise)
-# REQUIRED PACKAGES
-# None
-# REQUIRED FUNCTIONS FROM THE cute PACKAGE
-# None
-# EXAMPLE
-# test <- matrix(1:3) ; fun_check(data = test, print = TRUE, class = "vector", mode = "numeric")
-# see http
-# DEBUGGING
-# data = mean ; class = NULL ; typeof = NULL ; mode = NULL ; length = NULL ; prop = FALSE ; double.as.integer.allowed = FALSE ; options = "a" ; all.options.in.data = FALSE ; na.contain = FALSE ; neg.values = TRUE ; print = TRUE ; data.name = NULL ; fun.name = NULL
-# function name
-# no used in this function for the error message, to avoid env colliding
-# end function name
-# required function checking
-# end required function checking
-# reserved words
-# end reserved words
-# fun.name checked first because required next
-if( ! is.null(fun.name)){ # I have to use this way to deal with every kind of class for fun.name
-if(all(base::class(fun.name) == "character")){ # all() without na.rm -> ok because class(NA) is "logical"
-if(base::length(fun.name) != 1){
-tempo.cat <- paste0("ERROR IN fun_check(): THE fun.name ARGUMENT MUST BE A CHARACTER VECTOR OF LENGTH 1: ", paste(fun.name, collapse = " "))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}else if(any(is.na(fun.name))){ # normally no NA with is.na()
-tempo.cat <- paste0("ERROR IN fun_check(): NO ARGUMENT EXCEPT data AND options CAN HAVE NA VALUES\nPROBLEMATIC ARGUMENT IS fun.name")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}else{
-tempo.cat <- paste0("ERROR IN fun_check(): THE fun.name ARGUMENT MUST BE A CHARACTER VECTOR OF LENGTH 1") # paste(fun.name, collapse = " ") removed here because does not work with objects like function
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-# end fun.name checked first because required next
-# arg with no default values
-if(missing(data)){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" IN ", fun.name)), ": ARGUMENT data HAS NO DEFAULT VALUE AND REQUIRES ONE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end arg with no default values
-# argument primary checking
-# source("C:/Users/Gael/Documents/Git_versions_to_use/debugging_tools_for_r_dev-v1.7/r_debugging_tools-v1.7.R") ; eval(parse(text = str_basic_arg_check_dev)) # activate this line and use the function to check arguments status
-# end argument primary checking
-# second round of checking and data preparation
-# management of special classes
-basic.class <- c(
-"NULL", # because class(NULL) is "NULL". The NULL aspect will be dealt later
-"logical", 
-"integer", 
-"numeric", 
-# "complex", 
-"character"
-# "matrix", 
-# "array", 
-# "data.frame", 
-# "list", 
-# "factor", 
-# "table", 
-# "expression", 
-# "name", 
-# "symbol", 
-# "function", 
-# "uneval", 
-# "environment", 
-# "ggplot2", 
-# "ggplot_built", 
-# "call"
-)
-tempo.arg.base <-c( # no names(formals(fun = sys.function(sys.parent(n = 2)))) used with fun_check() to be sure to deal with the correct environment
-"class", 
-"typeof", 
-"mode", 
-"length", 
-"prop", 
-"double.as.integer.allowed", 
-"options", 
-"all.options.in.data", 
-"na.contain", 
-"neg.values", 
-"print", 
-"data.name", 
-"fun.name"
-)
-tempo.class <-list( # no get() used to be sure to deal with the correct environment
-base::class(class), 
-base::class(typeof), 
-base::class(mode), 
-base::class(length), 
-base::class(prop), 
-base::class(double.as.integer.allowed), 
-base::class(options), 
-base::class(all.options.in.data), 
-base::class(na.contain), 
-base::class(neg.values), 
-base::class(print), 
-base::class(data.name), 
-base::class(fun.name)
-)
-tempo <- ! sapply(lapply(tempo.class, FUN = "%in%", basic.class), FUN = all)
-if(any(tempo)){
-tempo.cat1 <- tempo.arg.base[tempo]
-tempo.cat2 <- sapply(tempo.class[tempo], FUN = paste0, collapse = " ")
-tempo.sep <- sapply(mapply(" ", max(nchar(tempo.cat1)) - nchar(tempo.cat1) + 3, FUN = rep, SIMPLIFY = FALSE), FUN = paste0, collapse = "")
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": ANY ARGUMENT EXCEPT data MUST HAVE A BASIC CLASS\nPROBLEMATIC ARGUMENT", ifelse(base::length(tempo.cat1) > 1, "S", ""), " AND ASSOCIATED CLASS", ifelse(base::length(tempo.cat1) > 1, "ES ARE", " IS"), ":\n", paste0(tempo.cat1, tempo.sep, tempo.cat2, collapse = "\n")) # normally no NA with is.na()
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end management of special classes
-# management of NA arguments
-if(any(is.na(data.name)) | any(is.na(class)) | any(is.na(typeof)) | any(is.na(mode)) | any(is.na(length)) | any(is.na(prop)) | any(is.na(double.as.integer.allowed)) | any(is.na(all.options.in.data)) | any(is.na(na.contain)) | any(is.na(neg.values)) | any(is.na(print)) | any(is.na(fun.name))){ # normally no NA with is.na()
-tempo <- c("data.name", "class", "typeof", "mode", "length", "prop", "double.as.integer.allowed", "all.options.in.data", "na.contain", "neg.values", "print", "fun.name")[c(any(is.na(data.name)), any(is.na(class)), any(is.na(typeof)), any(is.na(mode)), any(is.na(length)), any(is.na(prop)), any(is.na(double.as.integer.allowed)), any(is.na(all.options.in.data)), any(is.na(na.contain)), any(is.na(neg.values)), any(is.na(print)), any(is.na(fun.name)))]
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": NO ARGUMENT EXCEPT data AND options CAN HAVE NA VALUES\nPROBLEMATIC ARGUMENT", ifelse(length(tempo) > 1, "S ARE", " IS"), ":\n", paste(tempo, collapse = "\n")) # normally no NA with is.na()
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end management of NA arguments
-# management of NULL arguments
-tempo.arg <-c(
-"prop", 
-"double.as.integer.allowed", 
-"all.options.in.data", 
-"na.contain",
-"neg.values",
-"print"
-)
-tempo.log <- sapply(lapply(tempo.arg, FUN = get, env = sys.nframe(), inherit = FALSE), FUN = is.null)
-if(any(tempo.log) == TRUE){ # normally no NA with is.null()
-tempo.cat <- paste0("ERROR IN fun.check():\n", ifelse(sum(tempo.log, na.rm = TRUE) > 1, "THESE ARGUMENTS", "THIS ARGUMENT"), " CANNOT BE NULL:\n", paste0(tempo.arg[tempo.log], collapse = "\n"))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end management of NULL arguments
-# dealing with logical
-# tested below
-# end dealing with logical
-# code that protects set.seed() in the global environment
-# end code that protects set.seed() in the global environment
-# warning initiation
-# end warning initiation
-# other checkings
-if( ! is.null(data.name)){
-if( ! (base::length(data.name) == 1L & all(base::class(data.name) == "character"))){ # all() without na.rm -> ok because class(NA) is "logical"
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": data.name ARGUMENT MUST BE A SINGLE CHARACTER ELEMENT AND NOT ", paste(data.name, collapse = " "))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if(is.null(options) & is.null(class) & is.null(typeof) & is.null(mode) &  prop == FALSE & is.null(length)){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": AT LEAST ONE OF THE options, class, typeof, mode, prop, OR length ARGUMENT MUST BE SPECIFIED (I.E, TRUE FOR prop)")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if( ! is.null(options) & ( ! is.null(class) | ! is.null(typeof) | ! is.null(mode) | prop == TRUE)){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": THE class, typeof, mode ARGUMENTS MUST BE NULL, AND prop FALSE, IF THE options ARGUMENT IS SPECIFIED\nTHE options ARGUMENT MUST BE NULL IF THE class AND/OR typeof AND/OR mode AND/OR prop ARGUMENT IS SPECIFIED")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if( ! (all(base::class(neg.values) == "logical") & base::length(neg.values) == 1L)){ # all() without na.rm -> ok because class(NA) is "logical" 
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": THE neg.values ARGUMENT MUST BE TRUE OR FALSE ONLY")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if(neg.values == FALSE & is.null(class) & is.null(typeof) & is.null(mode)){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": THE neg.values ARGUMENT CANNOT BE SWITCHED TO FALSE IF class, typeof AND mode ARGUMENTS ARE NULL")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if( ! is.null(class)){ # may add "formula" and "Date" as in https://renenyffenegger.ch/notes/development/languages/R/functions/class
-if( ! all(class %in% c("vector", "logical", "integer", "numeric", "complex", "character", "matrix", "array", "data.frame", "list", "factor", "table", "expression", "name", "symbol", "function", "uneval", "environment", "ggplot2", "ggplot_built", "call") & base::length(class) == 1L)){ # length == 1L here because of class(matrix()) since R4.0.0  # all() without na.rm -> ok because class cannot be NA (tested above)
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": class ARGUMENT MUST BE ONE OF THESE VALUE:\n\"vector\", \"logical\", \"integer\", \"numeric\", \"complex\", \"character\", \"matrix\", \"array\", \"data.frame\", \"list\", \"factor\", \"table\", \"expression\", \"name\", \"symbol\", \"function\", \"environment\", \"ggplot2\", \"ggplot_built\", \"call\"")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if(neg.values == FALSE & ! any(class %in% c("vector", "numeric", "integer", "matrix", "array", "data.frame", "table"))){ # no need of na.rm = TRUE for any() because %in% does not output NA
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": class ARGUMENT CANNOT BE OTHER THAN \"vector\", \"numeric\", \"integer\", \"matrix\", \"array\", \"data.frame\", \"table\" IF neg.values ARGUMENT IS SWITCHED TO FALSE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if( ! is.null(typeof)){ # all the types are here: https://renenyffenegger.ch/notes/development/languages/R/functions/typeof
-if( ! (all(typeof %in% c("logical", "integer", "double", "complex", "character", "list", "expression", "symbol", "closure", "special", "builtin", "environment", "S4", "language")) & base::length(typeof) == 1L)){ # "language" is the type of object of class "call" # all() without na.rm -> ok because typeof cannot be NA (tested above)
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": typeof ARGUMENT MUST BE ONE OF THESE VALUE:\n\"logical\", \"integer\", \"double\", \"complex\", \"character\", \"list\", \"expression\", \"name\", \"symbol\", \"closure\", \"special\", \"builtin\", \"environment\", \"S4\", \"language\"")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if(neg.values == FALSE & ! typeof %in% c("double", "integer")){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": typeof ARGUMENT CANNOT BE OTHER THAN \"double\" OR \"integer\" IF neg.values ARGUMENT IS SWITCHED TO FALSE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if( ! is.null(mode)){ # all the types are here: https://renenyffenegger.ch/notes/development/languages/R/functions/typeof
-if( ! (all(mode %in% c("logical", "numeric", "complex", "character", "list", "expression", "name", "symbol", "function", "environment", "S4", "call")) & base::length(mode) == 1L)){ # all() without na.rm -> ok because mode cannot be NA (tested above)
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": mode ARGUMENT MUST BE ONE OF THESE VALUE:\n\"logical\", \"numeric\", \"complex\", \"character\", \"list\", \"expression\", \"name\", \"symbol\", \"function\", \"environment\", \"S4\", \"call\"")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if(neg.values == FALSE & mode != "numeric"){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": mode ARGUMENT CANNOT BE OTHER THAN \"numeric\" IF neg.values ARGUMENT IS SWITCHED TO FALSE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if( ! is.null(length)){
-if( ! (is.numeric(length) & base::length(length) == 1L & all( ! grepl(length, pattern = "\\.")))){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": length ARGUMENT MUST BE A SINGLE INTEGER VALUE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if( ! (is.logical(prop) & base::length(prop) == 1L)){ # is.na() already checked for prop
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": prop ARGUMENT MUST BE TRUE OR FALSE ONLY")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}else if(prop == TRUE){
-if( ! is.null(class)){
-if( ! any(class %in% c("vector", "numeric", "matrix", "array", "data.frame", "table"))){ # no need of na.rm = TRUE for any() because %in% does not output NA
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": class ARGUMENT CANNOT BE OTHER THAN NULL, \"vector\", \"numeric\", \"matrix\", \"array\", \"data.frame\", \"table\" IF prop ARGUMENT IS TRUE") # not integer because prop
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if( ! is.null(mode)){
-if(mode != "numeric"){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": mode ARGUMENT CANNOT BE OTHER THAN NULL OR \"numeric\" IF prop ARGUMENT IS TRUE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-if( ! is.null(typeof)){
-if(typeof != "double"){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": typeof ARGUMENT CANNOT BE OTHER THAN NULL OR \"double\" IF prop ARGUMENT IS TRUE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-}
-}
-if( ! (all(base::class(double.as.integer.allowed) == "logical") & base::length(double.as.integer.allowed) == 1L)){ # all() without na.rm -> ok because class() never returns NA
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": THE double.as.integer.allowed ARGUMENT MUST BE TRUE OR FALSE ONLY: ", paste(double.as.integer.allowed, collapse = " "))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if( ! (is.logical(all.options.in.data) & base::length(all.options.in.data) == 1L)){
-tempo.cat <- paste0("ERROR IN fun_check()", ifelse(is.null(fun.name), "", paste0(" INSIDE ", fun.name)), ": all.options.in.data ARGUMENT MUST BE A SINGLE LOGICAL VALUE (TRUE OR FALSE ONLY): ", paste(all.options.in.data, collapse = " "))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if( ! (all(base::class(na.contain) == "logical") & base::length(na.contain) == 1L)){ # all() without na.rm -> ok because class() never returns NA
-tempo.cat <- paste0("ERROR IN fun_check(): THE na.contain ARGUMENT MUST BE TRUE OR FALSE ONLY: ", paste(na.contain, collapse = " "))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-if( ! (all(base::class(print) == "logical") & base::length(print) == 1L)){ # all() without na.rm -> ok because class() never returns NA
-tempo.cat <- paste0("ERROR IN fun_check(): THE print ARGUMENT MUST BE TRUE OR FALSE ONLY: ", paste(print, collapse = " "))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# data.name and fun.name tested at the beginning
-# end other checkings
-# end second round of checking and data preparation
-# package checking
-# end package checking
-# main code
-if(is.null(data.name)){
-data.name <- deparse(substitute(data))
-}
-problem <- FALSE
-text <- paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT")
-if(( ! is.null(options)) & (all(base::typeof(data) == "character") | all(base::typeof(data) == "integer") | all(base::typeof(data) == "double"))){ # all() without na.rm -> ok because typeof() never returns NA
-if(all(base::typeof(data) == "double")){
-if( ! all(data %% 1 == 0L, na.rm = TRUE)){
-problem <- TRUE
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": THE ", data.name, " OBJECT MUST BE SOME OF THESE OPTIONS: ", paste(options, collapse = " "), "\nBUT IS NOT EVEN TYPE CHARACTER OR INTEGER")
-}
-}else{
-text <- ""
-if( ! all(data %in% options)){ # no need of na.rm = TRUE for all() because %in% does not output NA
-problem <- TRUE
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": THE ", data.name, " OBJECT MUST BE SOME OF THESE OPTIONS: ", paste(options, collapse = " "), "\nTHE PROBLEMATIC ELEMENTS OF ", data.name, " ARE: ", paste(unique(data[ ! (data %in% options)]), collapse = " "))
-}
-if(all.options.in.data == TRUE){
-if( ! all(options %in% data)){ # no need of na.rm = TRUE for all() because %in% does not output NA
-problem <- TRUE
-text <- paste0(ifelse(text == "", "", paste0(text, "\n")), ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": THE ", data.name, " OBJECT MUST BE MADE OF ALL THESE OPTIONS: ", paste(options, collapse = " "), "\nTHE MISSING ELEMENTS OF THE options ARGUMENT ARE: ",  paste(unique(options[ ! (options %in% data)]), collapse = " "))
-}
-}
-if( ! is.null(length)){
-if(base::length(data) != length){
-problem <- TRUE
-text <- paste0(ifelse(text == "", "", paste0(text, "\n")), ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": THE LENGTH OF ", data.name, " MUST BE ", length, " AND NOT ", base::length(data))
-}
-}
-if(text == ""){
-text <- paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT")
-}
-}
-}else if( ! is.null(options)){
-problem <- TRUE
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": THE ", data.name, " OBJECT MUST BE SOME OF THESE OPTIONS: ", paste(options, collapse = " "), "\nBUT IS NOT EVEN TYPE CHARACTER OR INTEGER")
-}
-arg.names <- c("class", "typeof", "mode", "length")
-if( ! is.null(class)){
-if(class == "matrix"){ # because of class(matric()) since R4.0.0
-class <- c("matrix", "array")
-}else if(class == "factor" & all(base::class(data) %in% c("factor", "ordered"))){ # to deal with ordered factors # all() without na.rm -> ok because class(NA) is "logical"
-class <- c("factor", "ordered")
-}
-}
-if(is.null(options)){
-for(i2 in 1:base::length(arg.names)){
-if( ! is.null(get(arg.names[i2], env = sys.nframe(), inherit = FALSE))){
-# script to execute
-tempo.script <- '
-problem <- TRUE ;
-if(identical(text, paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT"))){
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": THE ", data.name, " OBJECT MUST BE ") ;
-}else{
-text <- paste0(text, " AND ") ; 
-}
-text <- paste0(text, toupper(arg.names[i2]), " ", if(all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) %in% c("matrix", "array"))){"matrix"}else if(all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) %in% c("factor", "ordered"))){"factor"}else{get(arg.names[i2], env = sys.nframe(), inherit = FALSE)})
-' # no need of na.rm = TRUE for all() because %in% does not output NA
-# end script to execute
-if(base::typeof(data) == "double" & double.as.integer.allowed == TRUE & ((arg.names[i2] == "class" & all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) == "integer")) | (arg.names[i2] == "typeof" & all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) == "integer")))){ # no need of na.rm = TRUE for all() because == does not output NA if no NA in left of ==, which is the case for arg.names # typeof(data) == "double" means no factor allowed
-if( ! all(data %% 1 == 0L, na.rm = TRUE)){ # to check integers (use %%, meaning the remaining of a division): see the precedent line. isTRUE(all.equal(data%%1, rep(0, length(data)))) not used because we strictly need zero as a result. Warning: na.rm = TRUE required here for all()
-eval(parse(text = tempo.script)) # execute tempo.script
-}
-}else if( ! any(all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) %in% c("vector", "ggplot2"))) & ! all(eval(parse(text = paste0(arg.names[i2], "(data)"))) %in% get(arg.names[i2], env = sys.nframe(), inherit = FALSE))){ # test the four c("class", "typeof", "mode", "length") arguments with their corresponding function. No need of na.rm = TRUE for all() because %in% does not output NA # no need of na.rm = TRUE for all() because %in% does not output NA # no need of na.rm = TRUE for any() because get get(arg.names) does not contain NA
-eval(parse(text = tempo.script)) # execute tempo.script
-}else if(arg.names[i2] == "class" & all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) == "vector") & ! (all(base::class(data) %in% "numeric") | all(base::class(data) %in% "integer") | all(base::class(data) %in% "character") | all(base::class(data) %in% "logical"))){ # test class == "vector". No need of na.rm = TRUE for all() because %in% does not output NA # no need of na.rm = TRUE for all() because == does not output NA if no NA in left of ==, which is the case for arg.names
-eval(parse(text = tempo.script)) # execute tempo.script
-}else if(arg.names[i2] == "class" & all(get(arg.names[i2], env = sys.nframe(), inherit = FALSE) == "ggplot2") & ! all(base::class(data) %in% c("gg", "ggplot"))){ # test ggplot object # no need of na.rm = TRUE for all() because == does not output NA if no NA in left of ==, which is the case for arg.names # no need of na.rm = TRUE for all() because %in% does not output NA
-eval(parse(text = tempo.script)) # execute tempo.script
-}
-}
-}
-}
-if(prop == TRUE & all(base::typeof(data) == "double")){ # all() without na.rm -> ok because typeof(NA) is "logical"
-if(is.null(data) | any(data < 0 | data > 1, na.rm = TRUE)){ # works if data is NULL # Warning: na.rm = TRUE required here for any() # typeof(data) == "double" means no factor allowed
-problem <- TRUE
-if(identical(text, paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT"))){
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": ")
-}else{
-text <- paste0(text, " AND ")
-}
-text <- paste0(text, "THE ", data.name, " OBJECT MUST BE DECIMAL VALUES BETWEEN 0 AND 1")
-}
-}else if(prop == TRUE){
-problem <- TRUE
-if(identical(text, paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT"))){
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": ")
-}else{
-text <- paste0(text, " AND ")
-}
-text <- paste0(text, "THE ", data.name, " OBJECT MUST BE DECIMAL VALUES BETWEEN 0 AND 1")
-}
-if(all(base::class(data) %in% "expression")){ # no need of na.rm = TRUE for all() because %in% does not output NA
-data <- as.character(data) # to evaluate the presence of NA
-}
-if(na.contain == FALSE & (base::mode(data) %in% c("logical", "numeric", "complex", "character", "list"))){ # before it was ! (class(data) %in% c("function", "environment"))
-if(any(is.na(data)) == TRUE){ # not on the same line because when data is class envir or function , do not like that # normally no NA with is.na()
-problem <- TRUE
-if(identical(text, paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT"))){
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": ")
-}else{
-text <- paste0(text, " AND ")
-}
-text <- paste0(text, "THE ", data.name, " OBJECT CONTAINS NA WHILE NOT AUTHORIZED")
-}
-}
-if(neg.values == FALSE & all(base::mode(data) %in% "numeric") & ! any(base::class(data) %in% "factor")){ # no need of na.rm = TRUE for all() because %in% does not output NA
-if(any(data < 0, na.rm = TRUE)){ # Warning: na.rm = TRUE required here for any()
-problem <- TRUE
-if(identical(text, paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT"))){
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": ")
-}else{
-text <- paste0(text, " AND ")
-}
-text <- paste0(text, "THE ", data.name, " OBJECT MUST BE MADE OF NON NEGATIVE NUMERIC VALUES")
-}
-}else if(neg.values == FALSE){
-problem <- TRUE
-if(identical(text, paste0(ifelse(is.null(fun.name), "", paste0("IN ", fun.name, ": ")), "NO PROBLEM DETECTED FOR THE ", data.name, " OBJECT"))){
-text <- paste0(ifelse(is.null(fun.name), "ERROR", paste0("ERROR IN ", fun.name)), ": ")
-}else{
-text <- paste0(text, " AND ")
-}
-text <- paste0(text, "THE ", data.name, " OBJECT MUST BE MADE OF NON NEGATIVE VALUES BUT IS ", ifelse(any(base::class(data) %in% "factor"), "A FACTOR", "NOT EVEN MODE NUMERIC"))
-}
-if(print == TRUE & problem == TRUE){
-cat(paste0("\n\n================\n\n", text, "\n\n================\n\n"))
-}
-# output
-output <- list(problem = problem, text = text, object.name = data.name)
-return(output)
-# end output
-# end main code
-}
+# -> transferred into the cute package
+
 
 ######## fun_secu() #### verif that local variables are not present in other envs
 
@@ -713,275 +293,7 @@ return(output)
 # example sheet OK 
 # check all and any OK
 # -> clear to go Apollo
-fun_info <- function(
-data, 
-n = NULL, 
-warn.print = TRUE
-){
-# AIM
-# Provide a broad description of an object
-# WARNINGS
-# None
-# ARGUMENTS
-# data: object to analyse
-# n: positive integer value indicating the n first number of elements to display per compartment of the output list (i.e., head(..., n)). Write NULL to return all the elements. Does not apply for the $STRUCTURE compartment output
-# warn.print: logical. Print potential warnings at the end of the execution? If FALSE the warning messages are added in the output list as an additional compartment (or NULL if no message).
-# RETURN
-# A list containing information, depending on the class and type of data. The backbone is generally:
-# $NAME: name of the object
-# $CLASS: class of the object (class() value)
-# $TYPE: type of the object (typeof() value)
-# $LENGTH: length of the object (length() value)
-# $NA.NB: number of NA and NaN (only for type "logical", "integer", "double", "complex", "character" or "list")
-# $HEAD: head of the object (head() value)
-# $TAIL: tail of the object (tail() value)
-# $DIMENSION: dimension (only for object with dimensions)
-# $SUMMARY: object summary (summary() value)
-# $STRUCTURE: object structure (str() value)
-# $WARNING: warning messages (only if the warn.print argument is FALSE)
-# If data is made of numerics, provide also:
-# $INF.NB: number of Inf and -Inf
-# $RANGE: range after removing Inf and NA
-# $SUM: sum after removing Inf and NA
-# $MEAN: mean after removing Inf and NA
-# If data is a 2D object, provide also:
-# $ROW_NAMES: row names
-# $COL_NAMES: column names
-# If data is a data frame, provide also:
-# $COLUMN_TYPE: type of each column (typeof() value)
-# If data is a list, provide also:
-# $COMPARTMENT_NAMES: names of the comprtments
-# $COMPARTMENT_TYPE: type of each compartment (typeof() value)
-# REQUIRED PACKAGES
-# None
-# REQUIRED FUNCTIONS FROM THE cute PACKAGE
-# fun_check()
-# fun_get_message()
-# EXAMPLE
-# fun_info(data = 1:3)
-# see http
-# DEBUGGING
-# mat1 <- matrix(1:3) ; data = env1 ; n = NULL ; warn.print = TRUE # for function debugging
-# function name
-function.name <- paste0(as.list(match.call(expand.dots = FALSE))[[1]], "()")
-arg.names <- names(formals(fun = sys.function(sys.parent(n = 2)))) # names of all the arguments
-arg.user.setting <- as.list(match.call(expand.dots = FALSE))[-1] # list of the argument settings (excluding default values not provided by the user)
-# end function name
-# required function checking
-req.function <- c(
-"fun_check", 
-"fun_get_message"
-)
-tempo <- NULL
-for(i1 in req.function){
-if(length(find(i1, mode = "function")) == 0L){
-tempo <- c(tempo, i1)
-}
-}
-if( ! is.null(tempo)){
-tempo.cat <- paste0("ERROR IN ", function.name, "\nREQUIRED cute FUNCTION", ifelse(length(tempo) > 1, "S ARE", " IS"), " MISSING IN THE R ENVIRONMENT:\n", paste0(tempo, collapse = "()\n"))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end required function checking
-# reserved words
-# end reserved words
-# arg with no default values
-mandat.args <- c(
-"data"
-)
-tempo <- eval(parse(text = paste0("missing(", paste0(mandat.args, collapse = ") | missing("), ")")))
-if(any(tempo)){ # normally no NA for missing() output
-tempo.cat <- paste0("ERROR IN ", function.name, "\nFOLLOWING ARGUMENT", ifelse(length(mandat.args) > 1, "S HAVE", "HAS"), " NO DEFAULT VALUE AND REQUIRE ONE:\n", paste0(mandat.args, collapse = "\n"))
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end arg with no default values
-# argument primary checking
-arg.check <- NULL #
-text.check <- NULL #
-checked.arg.names <- NULL # for function debbuging: used by r_debugging_tools
-ee <- expression(arg.check <- c(arg.check, tempo$problem) , text.check <- c(text.check, tempo$text) , checked.arg.names <- c(checked.arg.names, tempo$object.name))
-if( ! is.null(n)){
-tempo <- fun_check(data = n, class = "vector", typeof = "integer", length = 1, double.as.integer.allowed = TRUE, fun.name = function.name) ; eval(ee)
-}else{
-# no fun_check test here, it is just for checked.arg.names
-tempo <- fun_check(data = n, class = "vector")
-checked.arg.names <- c(checked.arg.names, tempo$object.name)
-}
-tempo <- fun_check(data = warn.print, class = "logical", length = 1, fun.name = function.name) ; eval(ee)
-if(any(arg.check) == TRUE){ # normally no NA
-stop(paste0("\n\n================\n\n", paste(text.check[arg.check], collapse = "\n"), "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between == #
-}
-# source("C:/Users/Gael/Documents/Git_versions_to_use/debugging_tools_for_r_dev-v1.7/r_debugging_tools-v1.7.R") ; eval(parse(text = str_basic_arg_check_dev)) ; eval(parse(text = str_arg_check_with_fun_check_dev)) # activate this line and use the function (with no arguments left as NULL) to check arguments status and if they have been checked using fun_check()
-# end argument primary checking
-# second round of checking and data preparation
-# management of NA arguments
-tempo.arg <- names(arg.user.setting) # values provided by the user
-tempo.log <- suppressWarnings(sapply(lapply(lapply(tempo.arg, FUN = get, env = sys.nframe(), inherit = FALSE), FUN = is.na), FUN = any)) & lapply(lapply(tempo.arg, FUN = get, env = sys.nframe(), inherit = FALSE), FUN = length) == 1L # no argument provided by the user can be just NA
-if(any(tempo.log) == TRUE){ # normally no NA because is.na() used here
-tempo.cat <- paste0("ERROR IN ", function.name, ":\n", ifelse(sum(tempo.log, na.rm = TRUE) > 1, "THESE ARGUMENTS\n", "THIS ARGUMENT\n"), paste0(tempo.arg[tempo.log], collapse = "\n"),"\nCANNOT JUST BE NA")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end management of NA arguments
-# management of NULL arguments
-tempo.arg <-c(
-"data", 
-# "n", # because can be NULL
-"warn.print"
-)
-tempo.log <- sapply(lapply(tempo.arg, FUN = get, env = sys.nframe(), inherit = FALSE), FUN = is.null)
-if(any(tempo.log) == TRUE){# normally no NA with is.null()
-tempo.cat <- paste0("ERROR IN ", function.name, ":\n", ifelse(sum(tempo.log, na.rm = TRUE) > 1, "THESE ARGUMENTS\n", "THIS ARGUMENT\n"), paste0(tempo.arg[tempo.log], collapse = "\n"),"\nCANNOT BE NULL")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}
-# end management of NULL arguments
-# code that protects set.seed() in the global environment
-# end code that protects set.seed() in the global environment
-# warning initiation
-ini.warning.length <- options()$warning.length
-options(warning.length = 8170)
-warn <- NULL
-# warn.count <- 0 # not required
-# end warning initiation
-# other checkings
-if( ! is.null(n)){
-if(n < 1){
-tempo.cat <- paste0("ERROR IN ", function.name, ": n ARGUMENT MUST BE A POSITIVE AND NON NULL INTEGER")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}else if(is.finite(n)){
-# warn.count <- warn.count + 1
-tempo.warn <- paste0("SOME COMPARTMENTS CAN BE TRUNCATED (n ARGUMENT IS ", n, ")")
-warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn)))
-}
-}
-# end other checkings
-# reserved word checking
-# end reserved word checking
-# end second round of checking and data preparation
-# package checking
-# end package checking
-# main code
-# new environment
-env.name <- paste0("env", as.numeric(Sys.time()))
-if(exists(env.name, where = -1)){ # verify if still ok when fun_info() is inside a function
-tempo.cat <- paste0("ERROR IN ", function.name, ": ENVIRONMENT env.name ALREADY EXISTS. PLEASE RERUN ONCE")
-stop(paste0("\n\n================\n\n", tempo.cat, "\n\n================\n\n"), call. = FALSE) # == in stop() to be able to add several messages between ==
-}else{
-assign(env.name, new.env())
-assign("data", data, envir = get(env.name, env = sys.nframe(), inherit = FALSE)) # data assigned in a new envir for test
-}
-# end new environment
-data.name <- deparse(substitute(data))
-output <- list("NAME" = data.name)
-tempo.try.error <- fun_get_message(data = "class(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- list("CLASS" = class(data))
-output <- c(output, tempo)
-}
-tempo.try.error <- fun_get_message(data = "typeof(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- list("TYPE" = typeof(data))
-output <- c(output, tempo)
-}
-tempo.try.error <- fun_get_message(data = "length(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- list("LENGTH" = length(data))
-output <- c(output, tempo)
-}
-if(all(typeof(data) %in% c("integer", "numeric", "double")) & ! any(class(data) %in% "factor")){ # all() without na.rm -> ok because typeof(NA) is "logical" # any() without na.rm -> ok because class(NA) is "logical"
-tempo <- list("INF.NB" = sum(is.infinite(data)))
-output <- c(output, tempo)
-tempo <- list("RANGE" = range(data[ ! is.infinite(data)], na.rm = TRUE))
-output <- c(output, tempo)
-tempo <- list("SUM" = sum(data[ ! is.infinite(data)], na.rm = TRUE))
-output <- c(output, tempo)
-tempo <- list("MEAN" = mean(data[ ! is.infinite(data)], na.rm = TRUE))
-output <- c(output, tempo)
-}
-if(all(typeof(data) %in% c("logical", "integer", "double", "complex", "character", "list"))){ # all() without na.rm -> ok because typeof(NA) is "logical"
-tempo.try.error <- fun_get_message(data = "is.na(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- list("NA.NB" = sum(is.na(data)))
-output <- c(output, tempo)
-}
-}
-tempo.try.error <- fun_get_message(data = "head(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- list("HEAD" = head(data))
-output <- c(output, tempo)
-tempo <- list("TAIL" = tail(data)) # no reason that tail() does not work if head() works
-output <- c(output, tempo)
-}
-tempo.try.error <- fun_get_message(data = "dim(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-if(length(dim(data)) > 0){
-tempo <- list("DIMENSION" = dim(data))
-if(length(tempo[[1]]) == 2L){
-names(tempo[[1]]) <- c("NROW", "NCOL")
-}
-output <- c(output, tempo)
-}
-}
-if(all(class(data) == "data.frame") | all(class(data) %in% c("matrix", "array")) | all(class(data) == "table")){ # all() without na.rm -> ok because typeof(NA) is "logical"
-if(length(dim(data)) > 1){ # to avoid 1D table
-tempo <- list("ROW_NAMES" = dimnames(data)[[1]])
-output <- c(output, tempo)
-tempo <- list("COLUM_NAMES" = dimnames(data)[[2]])
-output <- c(output, tempo)
-}
-}
-tempo.try.error <- fun_get_message(data = "summary(data)", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- list("SUMMARY" = summary(data))
-output <- c(output, tempo)
-}
-tempo.try.error <- fun_get_message(data = "noquote(matrix(capture.output(str(data))))", kind = "error", header = FALSE, env = get(env.name, env = sys.nframe(), inherit = FALSE))
-if(is.null(tempo.try.error)){
-tempo <- capture.output(str(data))
-tempo <- list("STRUCTURE" = noquote(matrix(tempo, dimnames = list(rep("", length(tempo)), "")))) # str() print automatically, ls.str() not but does not give the order of the data.frame
-output <- c(output, tempo)
-}
-if(all(class(data) == "data.frame")){ # all() without na.rm -> ok because class(NA) is "logical"
-tempo <- list("COLUMN_TYPE" = sapply(data, FUN = "typeof"))
-if(any(sapply(data, FUN = "class") %in% "factor")){ # if an ordered factor is present, then sapply(data, FUN = "class") return a list but works with any(sapply(data, FUN = "class") %in% "factor") # any() without na.rm -> ok because class(NA) is "logical"
-tempo.class <- sapply(data, FUN = "class")
-if(any(unlist(tempo.class) %in% "ordered")){ # any() without na.rm -> ok because class(NA) is "logical"
-tempo2 <- sapply(tempo.class, paste, collapse = " ") # paste the "ordered" factor" in "ordered factor"
-}else{
-tempo2 <- unlist(tempo.class)
-}
-tempo[["COLUMN_TYPE"]][grepl(x = tempo2, pattern = "factor")] <- tempo2[grepl(x = tempo2, pattern = "factor")]
-}
-output <- c(output, tempo)
-}
-if(all(class(data) == "list")){ # all() without na.rm -> ok because class(NA) is "logical"
-tempo <- list("COMPARTMENT_NAMES" = names(data))
-output <- c(output, tempo)
-tempo <- list("COMPARTMENT_TYPE" = sapply(data, FUN = "typeof"))
-if(any(unlist(sapply(data, FUN = "class")) %in% "factor")){ # if an ordered factor is present, then sapply(data, FUN = "class") return a list but works with any(sapply(data, FUN = "class") %in% "factor")  # any() without na.rm -> ok because class(NA) is "logical"
-tempo.class <- sapply(data, FUN = "class")
-if(any(unlist(tempo.class) %in% "ordered")){ # any() without na.rm -> ok because class(NA) is "logical"
-tempo2 <- sapply(tempo.class, paste, collapse = " ") # paste the "ordered" factor" in "ordered factor"
-}else{
-tempo2 <- unlist(tempo.class)
-}
-tempo[["COMPARTMENT_TYPE"]][grepl(x = tempo2, pattern = "factor")] <- tempo2[grepl(x = tempo2, pattern = "factor")]
-}
-output <- c(output, tempo)
-}
-if( ! is.null(n)){
-output[names(output) != "STRUCTURE"] <- lapply(X = output[names(output) != "STRUCTURE"], FUN = head, n = n, simplify = FALSE)
-}
-# output
-if(warn.print == FALSE){
-output <- c(output, WARNING = warn)
-}else if(warn.print == TRUE & ! is.null(warn)){
-on.exit(warning(paste0("FROM ", function.name, ":\n\n", warn), call. = FALSE))
-}
-on.exit(exp = options(warning.length = ini.warning.length), add = TRUE)
-return(output)
-# end output
-# end main code
-}
+# -> transferred into the cute package
 
 
 ######## fun_head() #### head of the left or right of big 2D objects
diff --git a/cute_little_R_functions.docx b/cute_little_R_functions.docx
index 461b1020e927d9f96d29249cc755193bd81a93ab..5537d44d8601a07fc2008af7068a32e7ba27f060 100644
Binary files a/cute_little_R_functions.docx and b/cute_little_R_functions.docx differ
diff --git a/dev/TODO.txt b/dev/TODO.txt
index 7e4a2b7e5c7177ff02fd71569a049d3232c2d28f..ca880e24dbb4142df7fea7176f0f772f552dc18e 100644
--- a/dev/TODO.txt
+++ b/dev/TODO.txt
@@ -1,3 +1,35 @@
+
+
+20210616
+
+Hello.
+
+
+J'ai créé un nouveau repo:
+git@gitlab.pasteur.fr:gmillot/cute.git
+que vous pouvez cloner en local:
+git clone git@gitlab.pasteur.fr:gmillot/cute.git
+
+Ensuite vous pourrez travailler dessus et puis vous effectuerez des demandes de merge auprès 
+de moi pour que j'incorpore votre travail.
+
+L'idée est que ce repo soit rapidement converti en package.
+On peut commencer avec une seule fonction provenant de l'ancien repo de dev cute_little_r_function
+et ensuite incorporer petit à petit les fonctions cleanées de cute_little_r_function
+
+Pour demain je vois 5 axes :
+1) piger le passage en package / le faire sur le repo cute et noter la procédure pour les autres
+2) Piger / créer les pages web de docu
+3) poursuivre les feuilles d'exemple
+4) tester les fonctions et basculer sur cute
+5) updater fun_gg_scatter
+
+A voir ce qui plait à qui.
+
+A demain
+
+
+20210301
 L'investissement dans le projet Cute:
 1) Terminer les pages d'exemple de chaque fonction (c'est long)
 2) Checker les functions existantes (les utiliser, les challenger)
diff --git a/examples_fun_check.R b/examples_fun_check.R
deleted file mode 100644
index 56882f2d4e6c243d1cc187e2b09fbbd7c0769fdb..0000000000000000000000000000000000000000
--- a/examples_fun_check.R
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-######## fun_check() #### check class, type, length, etc., of objects
-
-### Datasets
-vec1 <- -1:3 # vector of integers
-vec2 <- 1:3 / 3 # vector of proportions
-vec3 <- c(1, 2, 3) # vector of integers but stored as "double"
-vec4 <- "pearson" # vector of characters
-vec5 <- c("a", "b","a", "b") # vector of characters
-mat1 <- matrix(vec1) # matrix of integers
-mat2 <- matrix(c(1:3 / 3, NA)) # matrix of proportions with NA
-
-
-### Datasets info
-vec1 # vector of integers
-vec2 # vector of proportions
-vec3 # vector of integers but stored as "double"
-vec4 # vector of characters
-vec5 # vector of characters
-mat1 # matrix of integers
-mat2 # matrix of proportions with NA
-
-
-### Simple examples
-# Check that vec1 is of class integer (means that it is also a vector) -> ok
-fun_check(data = vec1, class = "integer")
-# Check that vec1 is a numeric vector -> error because vec1 is a vector of integers
-fun_check(data = vec1, class = "numeric")
-# Check that vec1 is an integer vector of length 3 without negative values and without NA -> error because of length 5 and negative values inside vec1
-fun_check(data = vec1, class = "vector", typeof = "integer", length = 3, neg.values = FALSE, na.contain = FALSE)
-# No result displayed because the output list is assigned into res (see below the print argument)
-res <- fun_check(data = vec1, class = "integer")
-res
-# with NULL, the function systematically report a checking problem
-fun_check(data = NULL, class = "integer")
-
-### Argument class, typeof, mode and length are the same as the corresponding R function, except class which 1) has also "vector" and 2) remains "matrix" for matrices and not "matrix" "array"
-# Example
-fun_check(data = vec1, 
-    class = "vector", 
-    typeof = "integer", 
-    mode = "numeric", 
-    length = 5, 
-)
-# Warning: the function does not check for inconsistencies between arguments. It just checks if everything is ok between arguments values and data
-fun_check(data = vec1, 
-    typeof = "integer", 
-    mode = "character", # the mode "character" exists but is inconsistant with typeof "integer". However, this aspect is not signaled by the function
-)
-# Error message due to wrong value in the class and length arguments
-fun_check(data = vec1, 
-    mode = "integer", # the mode "integer" does not exist in the mode() function of R
-)
-
-### Argument prop
-fun_check(data = mat2, 
-    prop = TRUE # Check for values between 0 and 1 only
-)
-
-### Argument double.as.integer.allowed
-fun_check(data = vec3, typeof = "integer",
-    double.as.integer.allowed = TRUE # with TRUE, integers stored as double are accepted
-)
-
-### Argument options
-fun_check(data = vec4, 
-    options = c("pearson", "spearman", "kendall")
-)
-
-### Argument all.options.in.data
-# No error
-fun_check(data = vec5,
-    options = c("a", "b"), 
-    all.options.in.data = TRUE
-)
-# No error
-fun_check(data = vec5,
-    options = c("a", "b", "c"), 
-    all.options.in.data = FALSE
-)
-# Error
-fun_check(data = vec5,
-    options = c("a", "b", "c"), 
-    all.options.in.data = TRUE
-)
-
-### Argument na.contain
-fun_check(data = mat2, class = "matrix", prop = TRUE,
-    na.contain = FALSE # with TRUE, integers stored as double are accepted
-)
-
-### Argument neg.values
-# Warning: only considered if set to FALSE, to check for non negative values when class is set to "vector", "numeric", "matrix", "array", "data.frame", "table", or typeof is set to "double", "integer", or mode is set to "numeric"
-fun_check(data = mat1, class = "matrix",
-    neg.values = FALSE # with TRUE, integers stored as double are accepted
-)
-
-### Argument print
-# No error message printed because print is FALSE
-res <- fun_check(data = mat1, class = "data.frame",
-    print = FALSE
-)
-# Error message printed
-res <- fun_check(data = mat1, class = "data.frame",
-    print = TRUE
-)
-# Even if print is TRUE, no error message printed because no error
-res <- fun_check(data = mat1, class = "matrix",
-    print = TRUE
-)
-
-
-### Arguments data.name and fun.name
-# Example
-tempo <- fun_check(data = vec1, class = "integer", 
-    data.name = "OBSERVATION_1", 
-    fun.name = "FUNCTION_1"
-)
-tempo$text
-# In fact, these two arguments are interesting when fun_check() is used inside functions
-fun1 <- function(arg1){
-    tempo <- fun_check(data = arg1, class = "integer", 
-        data.name = NULL, # if NULL, the name displayed is arg1
-        fun.name = NULL # if NULL, no name displayed
-    )
-    if(tempo$problem == TRUE){
-        cat(paste0("\n\n================\n\n", tempo$text, "\n\n================\n\n"))
-    }
-}
-fun1(arg1 = vec4) # error message because arg1 requires a vector of integers
-
-
-
-### All the arguments
-# See the examples of fun_info() to test different classes of objects
-fun_check(
-    data = vec1, 
-    class = "integer", 
-    typeof = NULL, 
-    mode = NULL, 
-    length = NULL, 
-    prop = FALSE, 
-    double.as.integer.allowed = FALSE, 
-    options = NULL, 
-    all.options.in.data = FALSE, 
-    na.contain = FALSE, 
-    neg.values = TRUE, 
-    print = FALSE, 
-    data.name = NULL, 
-    fun.name = NULL
-)
-
diff --git a/examples_fun_info.R b/examples_fun_info.R
deleted file mode 100644
index 079087d5db57c6dd7ea6639bd3d85bc4d4c99a21..0000000000000000000000000000000000000000
--- a/examples_fun_info.R
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-######## fun_info() #### recover object information
-
-### Datasets
-vec1 <- -1:3 # vector of integers
-vec2 <- 1:3 / 3 # vector of proportions
-vec3 <- c(1, 2, NA, -Inf) # vector of integers but stored as "double", with NA and Inf
-vec4 <- "pearson" # vector of characters
-vec5 <- c("a", "b","a", NA) # vector of characters with NA
-cpx <- as.complex(1) # complex
-mat1 <- matrix(vec1) # 1D matrix of integers
-mat2 <- matrix(c(1:5, NA), ncol = 2, dimnames = list(c("ROW1", "ROW2", "ROW3"), c("M1", "M2"))) # 2D matrix of floats with NA
-df1 <- as.data.frame(mat2) # data.frame
-l1 <- list(L1 = 1:3, L2 = letters[1:3]) # list
-fac1 <- factor(rep(letters[4:6], c(4:6))) # factor
-tab1 <- table(fac1) # 1D table
-tab2 <- table(fac1, fac1) # 2D table
-exp1 <- expression("a") # object of class "expression", mode "expression" & type "expression"
-name1 <- substitute(exp1) # object of class "name", mode "name" & type "symbol"
-fun1 <- mean # closure function of class "function", mode "function" & type "closure"
-fun2 <- sum # primitive function of class "function", mode "function" & type "builtin"
-fun3 <- get("<-") # primitive function of class "function", mode "function" &  type "special"
-env1 <- new.env() # environment
-s4 <- show # S4 object
-call1 <- call("call1") # object of class "call", mode "call" & type "language"
-
-### Datasets info
-vec1 # vector of integers
-vec2 # vector of proportions
-vec3 # vector of integers but stored as "double", with NA
-vec4 # vector of characters
-vec5 # vector of characters with NA
-mat1 # 1D matrix of integers
-mat2 # 2D matrix of floats with NA
-df1 # data.frame
-l1 # list
-fac1 # factor
-tab1 # 1D table
-tab2 # 2D table
-exp1 # object of class "expression", mode "expression" & type "expression"
-name1 # object of class "name", mode "name" & type "symbol"
-fun1 # closure function of class "function", mode "function" & type "closure"
-fun2 # primitive function of class "function", mode "function" & type "builtin"
-fun3 # primitive function of class "function", mode "function" &  type "special"
-env1 # environment
-s4 # S4 object
-call1 # object of class "call", mode "call" &  type "language"
-
-
-### Simple example
-fun_info(data = vec1) # vector of integers
-fun_info(data = vec2) # vector of proportions
-fun_info(data = vec3) # vector of integers but stored as "double", with NA and Inf
-fun_info(data = vec4) # vector of characters
-fun_info(data = vec5) # vector of characters with NA
-fun_info(data = mat1) # 1D matrix of integers
-fun_info(data = mat2) # 2D matrix of floats with NA
-fun_info(data = df1) # data.frame
-fun_info(data = l1) # list
-fun_info(data = fac1) # factor
-fun_info(data = tab1) # 1D table
-fun_info(data = tab2) # 2D table
-fun_info(data = exp1) # object of class "expression", mode "expression" & type "expression"
-fun_info(data = name1) # object of class "name", mode "name" & type "symbol"
-fun_info(data = fun1) # closure function of class "function", mode "function" & type "closure"
-fun_info(data = fun2) # primitive function of class "function", mode "function" & type "builtin"
-fun_info(data = fun3) # primitive function of class "function", mode "function" &  type "special"
-fun_info(data = env1) # environment
-fun_info(data = s4) # S4 object
-fun_info(data = call1) # object of class "call", mode "call" &  type "language"
-
-
-
-### All the arguments
-fun_info(
-    data = vec1, 
-    n = 1, # number of element to display per compartment of the output list (i.e., head(..., n))
-    warn.print = FALSE
-)
-
-
-
-