1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 11:11:54 +02:00

(v1.3.0.9032) support skimr

This commit is contained in:
2020-09-28 01:08:55 +02:00
parent 22f6ceb3e4
commit 519aada54f
25 changed files with 123 additions and 30 deletions

14
R/mic.R
View File

@ -296,3 +296,17 @@ unique.mic <- function(x, incomparables = FALSE, ...) {
attributes(y) <- attributes(x)
y
}
# will be exported using s3_register() in R/zzz.R
get_skimmers.mic <- function(column) {
sfl <- import_fn("sfl", "skimr", error_on_fail = FALSE)
inline_hist <- import_fn("inline_hist", "skimr", error_on_fail = FALSE)
sfl(
skim_type = "mic",
min = ~as.character(sort(na.omit(.))[1]),
max = ~as.character(sort(stats::na.omit(.))[length(stats::na.omit(.))]),
median = ~as.character(stats::na.omit(.)[as.double(stats::na.omit(.)) == median(as.double(stats::na.omit(.)))])[1],
n_unique = n_unique,
hist_log2 = ~inline_hist(log2(as.double(stats::na.omit(.))))
)
}