diff --git a/cute_little_R_functions.R b/cute_little_R_functions.R index 4a8ffced061d812d931279e2632a5555f1f485d5..9cf7811186c23ea77958323ae631eaef7598cfbf 100644 --- a/cute_little_R_functions.R +++ b/cute_little_R_functions.R @@ -10,6 +10,7 @@ +# BEWARE: do not forget to save the modifications in the .R file (through RSTUDIO for indentation) ################################ OUTLINE ################################ @@ -296,8 +297,10 @@ fun_object_info <- function(data){ # data: object to test # RETURN # a list containing the info + # use names(fun_object_info()) and remove what can be to big for easy analysis # EXAMPLES # fun_object_info(data = 1:3) + # fun_object_info(data.frame(a = 1:2, b = ordered(factor(c("A", "B"))))) # fun_object_info(list(a = 1:3, b = ordered(factor(c("A", "B"))))) # DEBUGGING # data = NULL # for function debugging @@ -1588,7 +1591,7 @@ fun_open_window <- function(pdf.disp = TRUE, path.fun = "working.dir", pdf.name. if(pdf.disp == TRUE){ pdf.loc <- paste0(path.fun, "/", pdf.name.file, ".pdf") if(file.exists(pdf.loc) == TRUE & no.pdf.overwrite == TRUE){ - tempo.cat <- paste0("\n\n================\n\nERROR IN fun_open_window(): pdf.loc FILE ALREADY EXISTS AND CANNOT BE OVERWRITTEN DUE TO no.pdf.overwrite ARGUMENT SET TO TRUE\n\n================\n\n") + tempo.cat <- paste0("\n\n================\n\nERROR IN fun_open_window(): pdf.loc FILE ALREADY EXISTS AND CANNOT BE OVERWRITTEN DUE TO no.pdf.overwrite ARGUMENT SET TO TRUE: ", pdf.loc, "\n\n================\n\n") stop(tempo.cat) }else{ pdf(width = width.fun, height = height.fun, file=pdf.loc, paper = paper) diff --git a/cute_little_R_functions.docx b/cute_little_R_functions.docx index 2062a4de64a9b05144e032bef8d15a824a861250..45fe5edeaee18991c4cafead7e06d6192404186b 100644 Binary files a/cute_little_R_functions.docx and b/cute_little_R_functions.docx differ diff --git a/examples_alone.txt b/examples_alone.txt index fcafc77607abfc698dd4a143c7a83cb625060669..9aab8e31c765e5576a585f9389e3d5f94b902ab2 100644 --- a/examples_alone.txt +++ b/examples_alone.txt @@ -4,6 +4,7 @@ test <- 1:3 ; fun_param_check(data = test, data.name = NULL, print = TRUE, optio test <- 1:3 ; fun_param_check(data = test, print = TRUE, class = "numeric", typeof = NULL, double.as.integer.allowed = FALSE) fun_object_info(data = 1:3) + fun_object_info(data.frame(a = 1:2, b = ordered(factor(c("A", "B"))))) fun_object_info(list(a = 1:3, b = ordered(factor(c("A", "B"))))) obs1 = 1:5 ; obs2 = 1:5 ; names(obs1) <- LETTERS[1:5] ; names(obs2) <- LETTERS[1:5] ; fun_1D_comp(obs1, obs2)