diff --git a/examples.R b/examples_fun_check.R similarity index 59% rename from examples.R rename to examples_fun_check.R index f9d10cf258104c57a365ceacc7630e6a075b4894..56882f2d4e6c243d1cc187e2b09fbbd7c0769fdb 100644 --- a/examples.R +++ b/examples_fun_check.R @@ -151,91 +151,3 @@ fun_check( fun.name = NULL ) - - - - - - -######## 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 -) - - - - diff --git a/examples_fun_info.R b/examples_fun_info.R new file mode 100644 index 0000000000000000000000000000000000000000..079087d5db57c6dd7ea6639bd3d85bc4d4c99a21 --- /dev/null +++ b/examples_fun_info.R @@ -0,0 +1,87 @@ + + + + + +######## 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 +) + + + + diff --git a/fun_gg_boxplot.docx b/fun_gg_boxplot.docx index 7f40665dcccc23faf6cfc15fbe95d640dce51838..fe616409ac23629f801bd260f2f7a75b0c9e4804 100644 Binary files a/fun_gg_boxplot.docx and b/fun_gg_boxplot.docx differ diff --git a/other/cute_checks.docx b/other/cute_checks.docx index c3026642aed452144c9324e738e9397488940b57..dd953a9a1201a2b8de53f8de48ef2431c3c6bc11 100644 Binary files a/other/cute_checks.docx and b/other/cute_checks.docx differ