|
1 | | -check_early <- function() { |
2 | | - devtools::check() |
3 | | -} |
| 1 | + |
4 | 2 | get_hash <- function(n = 50) { |
5 | 3 | a <- do.call(paste0, replicate(3, sample(LETTERS, n, TRUE), FALSE)) |
6 | 4 | paste0(a, sprintf("%04d", sample(9999, n, TRUE)), sample(LETTERS, n, TRUE)) |
@@ -53,15 +51,19 @@ get_print_tibble <- function(x) { |
53 | 51 | a <- utils::capture.output(print(x)) |
54 | 52 | paste0(a, collapse = "\n") |
55 | 53 | } |
| 54 | + |
56 | 55 | assign_ <- function(name, data) { |
| 56 | + # development related function |
57 | 57 | # assign(name , data , envir = rlang::global_env()) |
58 | 58 | } |
59 | 59 | hash_func <- function(v) { |
60 | 60 | g <- paste0(v, collapse = "_") |
61 | | - name. <- digest::digest(g) |
62 | | - name. |
| 61 | + digest::digest(g) |
| 62 | + |
63 | 63 | } |
| 64 | + |
64 | 65 | g <- glue::glue |
| 66 | + |
65 | 67 | get_safe <- function(item, env = rlang::global_env(), default = F) { |
66 | 68 | sonuc <- default |
67 | 69 | try(silent = T, { |
@@ -91,13 +93,7 @@ is_bad <- function(item = NA) { |
91 | 93 | inv <- function(...) { |
92 | 94 | invisible(...) |
93 | 95 | } |
94 | | -gwrap <- function(..., env = rlang::caller_env(), color = crayon::blue) { |
95 | | - .f <- function(...) { |
96 | | - x <- glue::glue(..., .envir = env) |
97 | | - color(x) |
98 | | - } |
99 | | - .f(...) |
100 | | -} |
| 96 | + |
101 | 97 | enumerate <- function(items = c("a", "b", "c")) { |
102 | 98 | rlist::list.zip( |
103 | 99 | index = seq(len(items)), |
@@ -156,9 +152,10 @@ create_cache_name_from_list <- function(dots) { |
156 | 152 | v <- unlist(dots) |
157 | 153 | h <- hash_func(v) |
158 | 154 | } |
| 155 | + |
159 | 156 | success <- function(...) { |
160 | 157 | args <- list(...) |
161 | 158 | for (item in args) { |
162 | | - cat(crayon::green$bold(paste("\n", item))) |
| 159 | + .green(paste("\n", item)) |
163 | 160 | } |
164 | 161 | } |
0 commit comments