No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
3e800ac
... +3 ...
c5966f9
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
88 | 88 | if (!sparse) { |
|
89 | 89 | if (!is.null(maximum_size)) { |
|
90 | 90 | matrix_size <- (length(unique(tbl[[row]])) * |
|
91 | - | length(unique(tbl[[column]]))) |
|
91 | + | length(unique(tbl[[column]]))) |
|
92 | 92 | if (matrix_size > maximum_size) { |
|
93 | - | stop("Size of acast matrix, ", matrix_size, |
|
94 | - | " will be too large. Set maximum_size = NULL to avoid ", |
|
95 | - | "this error (make sure your memory is sufficient), ", |
|
96 | - | "or consider using sparse = TRUE.") |
|
93 | + | rlang::abort( |
|
94 | + | paste0("Size of acast matrix, ", matrix_size, |
|
95 | + | " will be too large. Set maximum_size = NULL to avoid ", |
|
96 | + | "this error (make sure your memory is sufficient), ", |
|
97 | + | "or consider using sparse = TRUE.") |
|
98 | + | ) |
|
97 | 99 | } |
|
98 | 100 | } |
|
99 | 101 | ||
100 | 102 | form <- stats::as.formula(paste(row, column, sep = " ~ ")) |
|
101 | 103 | ||
102 | 104 | input <- reshape2::acast(tbl, form, value.var = value, fill = 0) |
|
103 | 105 | } else { |
|
104 | - | input <- tidytext::cast_sparse_(tbl, row, column, value) |
|
106 | + | input <- tidytext::cast_sparse(tbl, !!row, !!column, !!value) |
|
105 | 107 | } |
|
106 | 108 | output <- purrr::as_mapper(.f)(input, ...) |
|
107 | 109 |
123 | 125 | #' @noRd |
|
124 | 126 | custom_melt <- function(m) { |
|
125 | 127 | if (inherits(m, "data.frame")) { |
|
126 | - | stop("Output is a data frame: don't know how to fix") |
|
128 | + | rlang::abort("Output is a data frame: don't know how to fix") |
|
127 | 129 | } |
|
128 | 130 | if (inherits(m, "matrix")) { |
|
129 | 131 | ret <- reshape2::melt(m, varnames = c("item1", "item2"), as.is = TRUE) |
19 | 19 | #' @examples |
|
20 | 20 | #' |
|
21 | 21 | #' library(dplyr) |
|
22 | - | #' dat <- data_frame(group = rep(1:5, each = 2), |
|
23 | - | #' letter = c("a", "b", |
|
24 | - | #' "a", "c", |
|
25 | - | #' "a", "c", |
|
26 | - | #' "b", "e", |
|
27 | - | #' "b", "f")) |
|
22 | + | #' dat <- tibble(group = rep(1:5, each = 2), |
|
23 | + | #' letter = c("a", "b", |
|
24 | + | #' "a", "c", |
|
25 | + | #' "a", "c", |
|
26 | + | #' "b", "e", |
|
27 | + | #' "b", "f")) |
|
28 | 28 | #' |
|
29 | 29 | #' # count the number of times two letters appear together |
|
30 | 30 | #' pairwise_count(dat, letter, group) |
22 | 22 | #' |
|
23 | 23 | #' library(dplyr) |
|
24 | 24 | #' |
|
25 | - | #' dat <- data_frame(group = rep(1:5, each = 2), |
|
26 | - | #' letter = c("a", "b", |
|
27 | - | #' "a", "c", |
|
28 | - | #' "a", "c", |
|
29 | - | #' "b", "e", |
|
30 | - | #' "b", "f")) |
|
25 | + | #' dat <- tibble(group = rep(1:5, each = 2), |
|
26 | + | #' letter = c("a", "b", |
|
27 | + | #' "a", "c", |
|
28 | + | #' "a", "c", |
|
29 | + | #' "b", "e", |
|
30 | + | #' "b", "f")) |
|
31 | 31 | #' |
|
32 | 32 | #' # how informative is each letter about each other letter |
|
33 | 33 | #' pairwise_pmi(dat, letter, group) |
Files | Coverage |
---|---|
Project Totals (11 files) | 65.57% |
c5966f9
e29286a
3c8de16
c70edfe
3e800ac