Commit 502006bb authored by Gael  MILLOT's avatar Gael MILLOT

v2.0.0 release

parent 191cc785
#### DESCRIPTION
Cute Little Functions contains 16 functions for R/RStudio that facilitate basic procedures in 1) object analysis, 2) object modification, 3) graphic handling and 4) log file management.
The function names are:
fun_param_check()
fun_object_info()
fun_1D_comp()
fun_2D_comp()
fun_list_comp()
fun_dataframe_flipping()
fun_refactorization()
fun_rounding()
fun_90clock_matrix_rot()
fun_hexa_hsv_color_matrix()
fun_window_width_resizing()
fun_open_window()
fun_graph_param_prior_plot()
fun_feature_post_plot()
fun_close_specif_window()
fun_export_data()
#### HOW TO USE IT
......@@ -9,16 +26,18 @@ Download the desired Tagged version, never the current master.
Source the cute_little_functions.R into R/RStudio to have the functions available in the working environment.
Description of the functions is at the beginning of the function body, to obtain it:
Description of the functions is at the beginning of the function body. To obtain it:
1) Open the cute_little_functions.docx or cute_little_functions.R file.
Either read the cute_little_functions.docx (or open the cute_little_functions.R file).
2) In the R/RStudio console, type the name of the function without brackets. Example : fun_object_info
Or in the R/RStudio console, type the name of the function without brackets. Example : fun_object_info.
#### ATTACHED FILES
#### FILE DESCRIPTIONS
The cute_little_functions.docx is just for easier reading.
cute_little_functions.R file that has to be sourced
cute_little_functions.docx just for easier code reading
examples_alone.txt compile all the examples of each of the 16 functions into a single file
#### WEB LOCATION
......@@ -26,6 +45,17 @@ The cute_little_functions.docx is just for easier reading.
Check for updated versions (more recent release tags) at https://gitlab.pasteur.fr/gmillot/cute_little_functions
#### WHAT'S NEW IN v1.3
#### WHAT'S NEW IN
1) fun_1D_comp() function improved: provide the common elements, common names and common levels if exist
## v2.0.0
1) fun_feature_post_plot() function improved: Now independent magnification for x axis/labels and y axis/labels. BEWARE: argument names have been modified
2) Bug corrected in fun_graph_param_prior_plot() function
3) Bug corrected in fun_refactorization() function
## v1.3
1) fun_1D_comp() function improved: provide the common elements, common names and common levels if exist.
This diff is collapsed.
......@@ -27,11 +27,11 @@ obs <- data.frame(a = 1:3, b = c("A", "B", "A")) ; fun_dataframe_flipping(obs)
obs <- data.frame(a = 1:3, b = c("A", "B", "A")) ; fun_dataframe_flipping(obs, quanti.col.name = "quanti", quali.col.name = "quali")
obs <- data.frame(a = 1:3, b = 4:6) ; fun_dataframe_flipping(obs)
obs <- data.frame(a = LETTERS[1:6], b = paste0(letters[1.6], c(1,1,2,2,3,3)), c = ordered(LETTERS[7:12]), d = 1:6)[-c(1:2),] ; fun_refactorization(obs, FALSE)
obs <- data.frame(a = LETTERS[1:6], b = paste0(letters[1.6], c(1,1,2,2,3,3)), c = ordered(LETTERS[7:12]), d = 1:6)[-c(1:2),] ; fun_refactorization(obs, TRUE)
obs <- factor(LETTERS[1:6])[-c(1:2)] ; fun_refactorization(obs, TRUE)
obs <- ordered(LETTERS[1:6])[-c(1:2)] ; fun_refactorization(obs, TRUE)
obs <- factor(LETTERS[1:6], levels = rev(LETTERS[1:6]))[-c(1:2)] ; fun_refactorization(obs, FALSE)
obs <- data.frame(a = LETTERS[1:6], b = paste0(letters[1.6], c(1,1,2,2,3,3)), c = ordered(LETTERS[7:12]), d = 1:6, e = "A")[-c(1:2),] ; sapply(obs, levels) ; fun_refactorization(obs, FALSE)
obs <- data.frame(a = LETTERS[1:6], b = paste0(letters[1.6], c(1,1,2,2,3,3)), c = ordered(LETTERS[7:12]), d = 1:6, e = "A")[-c(1:2),] ; sapply(obs, levels) ; fun_refactorization(obs, TRUE)
obs <- factor(LETTERS[1:6])[-c(1:2)] ; obs ; fun_refactorization(obs, TRUE)
obs <- ordered(LETTERS[1:6])[-c(1:2)] ; obs ; fun_refactorization(obs, TRUE)
obs <- factor(LETTERS[1:6], levels = rev(LETTERS[1:6]))[-c(1:2)] ; obs ; fun_refactorization(obs, FALSE)
fun_rounding(data = c(10, 100.001, 333.0001254, 12312.1235), dec.nb = 2, after.lead.zero = FALSE)
fun_rounding(data = c("10", "100.001", "333.0001254", "12312.1235"), dec.nb = 2, after.lead.zero = FALSE)
......@@ -48,9 +48,9 @@ fun_open_window(pdf.disp = FALSE, path.fun = "C:/Users/Gael/Desktop", pdf.name.f
fun_graph_param_prior_plot(param.reinitial = FALSE, xlog.scale = FALSE, ylog.scale = FALSE, remove.label = TRUE, remove.x.axis = TRUE, remove.y.axis = TRUE, down.space = 1, left.space = 1, up.space = 1, right.space = 1, orient = 1, dist.legend = 4.5, tick.length = 0.5, box.type = "n", amplif.label = 1, amplif.axis = 1, display.extend = FALSE, return.par = FALSE)
# Example of log axis with log y-axis and unmodified x-axis:
prior.par <- fun_graph_param_prior_plot(param.reinitial = TRUE, xlog.scale = FALSE, ylog.scale = TRUE, remove.label = TRUE, remove.x.axis = FALSE, remove.y.axis = TRUE, down.space = 1, left.space = 1, up.space = 1, right.space = 1, orient = 1, dist.legend = 0.5, tick.length = 0.5, box.type = "n", amplif.label = 1, amplif.axis = 1, display.extend = FALSE, return.par = TRUE) ; plot(1:100, log = "y") ; fun_feature_post_plot(y.side = 2, x.lab = "Values", y.lab = "TEST", y.dist.legend = 0.7, y.log.scale = prior.par$ylog, just.label.add = ! prior.par$ann)
prior.par <- fun_graph_param_prior_plot(param.reinitial = TRUE, xlog.scale = FALSE, ylog.scale = TRUE, remove.label = TRUE, remove.x.axis = FALSE, remove.y.axis = TRUE, down.space = 1, left.space = 1, up.space = 1, right.space = 1, orient = 1, dist.legend = 0.5, tick.length = 0.5, box.type = "n", amplif.label = 1, amplif.axis = 1, display.extend = FALSE, return.par = TRUE) ; plot(1:100, log = "y") ; fun_feature_post_plot(y.side = 2, y.log.scale = prior.par$ylog, x.lab = "Values", y.lab = "TEST", y.axis.magnific = 1.25, y.label.magnific = 1.5, y.dist.legend = 0.7, just.label.add = ! prior.par$ann)
# Example of log axis with redrawn x-axis and y-axis:
prior.par <- fun_graph_param_prior_plot(param.reinitial = TRUE) ; plot(1:100) ; fun_feature_post_plot(x.side = 1, x.lab = "Values", y.side = 2, y.lab = "TEST", y.dist.legend = 0.7)
prior.par <- fun_graph_param_prior_plot(param.reinitial = TRUE) ; plot(1:100) ; fun_feature_post_plot(x.side = 1, x.lab = "Values", y.side = 2, y.lab = "TEST", y.axis.magnific = 1, y.label.magnific = 2, y.dist.legend = 0.6)
windows() ; windows() ; pdf() ; dev.list() ; fun_close_specif_window(kind = c("pdf", "x11"), return.text = TRUE) ; dev.list()
......
Markdown is supported
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