CRAN Package Check Results for Package biogram

Last updated on 2019-12-16 00:48:49 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.4 3.34 44.65 47.99 ERROR
r-devel-linux-x86_64-debian-gcc 1.4 3.50 49.51 53.01 OK
r-devel-linux-x86_64-fedora-clang 1.4 84.06 OK
r-devel-linux-x86_64-fedora-gcc 1.4 83.03 OK
r-devel-windows-ix86+x86_64 1.4 11.00 108.00 119.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.4 9.00 112.00 121.00 OK
r-patched-linux-x86_64 1.4 4.16 59.20 63.36 OK
r-patched-solaris-x86 1.4 106.30 OK
r-release-linux-x86_64 1.4 3.62 58.42 62.04 OK
r-release-windows-ix86+x86_64 1.4 9.00 80.00 89.00 OK
r-release-osx-x86_64 1.4 OK
r-oldrel-windows-ix86+x86_64 1.4 6.00 70.00 76.00 OK
r-oldrel-osx-x86_64 1.4 OK

Check Details

Version: 1.4
Check: examples
Result: ERROR
    Running examples in 'biogram-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: biogram-package
    > ### Title: biogram - analysis of biological sequences using n-grams
    > ### Aliases: biogram biogram-package
    >
    > ### ** Examples
    >
    > # use data set from package
    > data(human_cleave)
    > # first nine columns represent subsequent nine amino acids from cleavage sites
    > # degenerate the sequence to reduce the dimensionality of the problem
    > # (use five groups instead of 20 amino acids)
    > deg_seqs <- degenerate(human_cleave[, 1L:9],
    + list(`a` = c(1, 6, 8, 10, 11, 18),
    + `b` = c(2, 13, 14, 16, 17),
    + `c` = c(5, 19, 20),
    + `d` = c(7, 9, 12, 15),
    + 'e' = c(3, 4)))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    biogram
     --- call from context ---
    degenerate(human_cleave[, 1L:9], list(a = c(1, 6, 8, 10, 11,
     18), b = c(2, 13, 14, 16, 17), c = c(5, 19, 20), d = c(7,
     9, 12, 15), e = c(3, 4)))
     --- call from argument ---
    if (class(seq) == "matrix") dim(tmp_seq) <- dim(seq)
     --- R stacktrace ---
    where 1: degenerate(human_cleave[, 1L:9], list(a = c(1, 6, 8, 10, 11,
     18), b = c(2, 13, 14, 16, 17), c = c(5, 19, 20), d = c(7,
     9, 12, 15), e = c(3, 4)))
    
     --- value of length: 2 type: logical ---
    [1] TRUE FALSE
     --- function from context ---
    function (seq, element_groups)
    {
     tmp_seq <- seq
     if (!all(unique(tmp_seq) %in% unlist(element_groups))) {
     warning("'seq' contains elements not present in 'element_groups'. \n Element(s): ",
     paste0(setdiff(unique(tmp_seq), unlist(element_groups)),
     collapse = ", "), " will be replaced by NA.")
     tmp_seq[!(tmp_seq %in% unlist(element_groups))] <- NA
     }
     if (is.null(names(element_groups))) {
     warning("'element_groups' is unnamed. Assumed names of groups are their ordinal numbers.")
     names(element_groups) <- 1L:length(element_groups)
     }
     if (length(unique(names(element_groups))) != length(names(element_groups))) {
     stop("'element_groups' must have unique names.")
     }
     for (i in 1L:length(element_groups)) {
     tmp_seq[tmp_seq %in% element_groups[[i]]] <- names(element_groups)[i]
     }
     if (class(seq) == "matrix")
     dim(tmp_seq) <- dim(seq)
     tmp_seq
    }
    <bytecode: 0x3a79bd0>
    <environment: namespace:biogram>
     --- function search by body ---
    Function degenerate in namespace biogram has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(seq) == "matrix") dim(tmp_seq) <- dim(seq) :
     the condition has length > 1
    Calls: degenerate
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.4
Check: tests
Result: ERROR
     Running 'test-all.R' [5s/6s]
    Running the tests in 'tests/test-all.R' failed.
    Complete output:
     > library(testthat)
     >
     > test_check("biogram")
     Loading required package: biogram
     Loading required package: slam
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     biogram
     --- call from context ---
     test_features(tar_feat1[, 1, drop = FALSE], cbind(tar_feat1[,
     2], tar_feat2[, 2], tar_feat3[, 2]))
     --- call from argument ---
     if (class(features) == "simple_triplet_matrix") {
     slam::col_sums(features)
     } else {
     colSums(features)
     }
     --- R stacktrace ---
     where 1 at testthat/test_quipt_consistency.R#8: test_features(tar_feat1[, 1, drop = FALSE], cbind(tar_feat1[,
     2], tar_feat2[, 2], tar_feat3[, 2]))
     where 2: eval(code, test_env)
     where 3: eval(code, test_env)
     where 4: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 8: doTryCatch(return(expr), name, parentenv, handler)
     where 9: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 10: tryCatchList(expr, classes, parentenv, handlers)
     where 11: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 12: test_code(desc, code, env = parent.frame())
     where 13 at testthat/test_quipt_consistency.R#3: test_that("Exact test and permutation test are consistent", {
     set.seed(1)
     tar_feat1 <- create_feature_target(10, 390, 0, 600)
     tar_feat2 <- create_feature_target(9, 391, 1, 599)
     tar_feat3 <- create_feature_target(8, 392, 2, 598)
     fast.results <- test_features(tar_feat1[, 1, drop = FALSE],
     cbind(tar_feat1[, 2], tar_feat2[, 2], tar_feat3[, 2]))
     m <- 10000
     perm.results <- test_features(tar_feat1[, 1, drop = FALSE],
     cbind(tar_feat1[, 2], tar_feat2[, 2], tar_feat3[, 2]),
     times = m, quick = FALSE)
     alfa <- 0.1
     conf.intervals <- sapply(perm.results, function(x) {
     x <- (x * m + 0.5 * qnorm(alfa)^2)/(m + qnorm(alfa)^2)
     x + qnorm(c(alfa/2, 1 - alfa/2)) * sqrt(x * (1 - x)/(m +
     qnorm(alfa)^2))
     })
     for (i in 1:3) {
     expect_true(fast.results[i] < conf.intervals[2, i])
     expect_true(fast.results[i] > conf.intervals[1, i])
     }
     })
     where 14: eval(code, test_env)
     where 15: eval(code, test_env)
     where 16: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 17: doTryCatch(return(expr), name, parentenv, handler)
     where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 20: doTryCatch(return(expr), name, parentenv, handler)
     where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 22: tryCatchList(expr, classes, parentenv, handlers)
     where 23: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 24: test_code(NULL, exprs, env)
     where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 26: force(code)
     where 27: doWithOneRestart(return(expr), restart)
     where 28: withOneRestart(expr, restarts[[1L]])
     where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 30: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 31: FUN(X[[i]], ...)
     where 32: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 33: force(code)
     where 34: doWithOneRestart(return(expr), restart)
     where 35: withOneRestart(expr, restarts[[1L]])
     where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 37: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 39: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 40: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 41: test_check("biogram")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (target, features, criterion = "ig", adjust = "BH",
     threshold = 1, quick = TRUE, times = 1e+05)
     {
     valid_criterion <- check_criterion(criterion)
     crit_function <- function(target, features) calc_criterion(target,
     features, valid_criterion[["crit_function"]])
     if (!all(target %in% c(0, 1))) {
     stop("'target' is not {0,1}-valued vector")
     }
     if (length(unique(target)) != 2) {
     stop("Both classes must be present in 'target'.")
     }
     if (nrow(features) != length(target)) {
     stop("'target' and 'features' have different number of cases.")
     }
     apply(features, 2, function(feature) {
     if (!all(feature %in% c(0, 1))) {
     stop("'features' are not {0,1}-valued matrix. Consider using binarize().")
     }
     })
     feature_size <- if (class(features) == "simple_triplet_matrix") {
     slam::col_sums(features)
     }
     else {
     colSums(features)
     }
     features <- features[, feature_size > threshold & feature_size <
     (nrow(features) - threshold), drop = FALSE]
     p_vals <- if (quick) {
     feature_size <- unique(feature_size)
     dists <- lapply(feature_size, function(i) {
     t <- create_feature_target(i, abs(sum(target) - i),
     0, abs(length(target) - sum(target)))
     distr_crit(t[, 1], t[, 2], criterion = criterion)
     })
     names(dists) <- feature_size
     apply(features, 2, function(feature) {
     feature <- as.matrix(feature, ncol = 1)
     estm <- crit_function(target, feature)
     dist <- dists[[paste(sum(feature))]]
     1 - dist[which.max(dist[, "criterion"] >= estm -
     1e-15), "cdf"]
     })
     }
     else {
     rowMeans(crit_function(target, features) <= replicate(times,
     crit_function(sample(target), features)))
     }
     p_vals[p_vals > 1] <- 1
     if (!is.null(adjust))
     p_vals <- p.adjust(p_vals, method = adjust)
     create_feature_test(p_value = p_vals, criterion = valid_criterion[["nice_name"]],
     adjust = adjust, times = ifelse(quick, NA, times), occ = calc_occurences(target,
     features))
     }
     <bytecode: 0x26dbb68>
     <environment: namespace:biogram>
     --- function search by body ---
     Function test_features in namespace biogram has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 1. Error: Exact test and permutation test are consistent (@test_quipt_consist
     the condition has length > 1
     Backtrace:
     1. biogram::test_features(...)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     biogram
     --- call from context ---
     seq2ngrams(seqs, 3, 1L:4)
     --- call from argument ---
     if (class(seq) != "matrix") seq <- matrix(seq, nrow = 1)
     --- R stacktrace ---
     where 1: seq2ngrams(seqs, 3, 1L:4)
     where 2: eval_bare(expr, quo_get_env(quo))
     where 3: quasi_label(enquo(object), label, arg = "object")
     where 4 at testthat/test_seq2grams.R#6: expect_equal(seq2ngrams(seqs, 3, 1L:4), structure(c("4.1.4_0.0",
     "2.1.3_0.0", "1.4.1_0.0", "1.3.3_0.0", "4.1.1_0.0", "3.3.1_0.0"),
     .Dim = 2:3))
     where 5: eval(code, test_env)
     where 6: eval(code, test_env)
     where 7: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 8: doTryCatch(return(expr), name, parentenv, handler)
     where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 13: tryCatchList(expr, classes, parentenv, handlers)
     where 14: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 15: test_code(desc, code, env = parent.frame())
     where 16 at testthat/test_seq2grams.R#3: test_that("Extract ngrams for different distances", {
     seqs <- structure(c(4L, 2L, 1L, 1L, 4L, 3L, 1L, 3L, 1L, 1L),
     .Dim = c(2L, 5L))
     expect_equal(seq2ngrams(seqs, 3, 1L:4), structure(c("4.1.4_0.0",
     "2.1.3_0.0", "1.4.1_0.0", "1.3.3_0.0", "4.1.1_0.0", "3.3.1_0.0"),
     .Dim = 2:3))
     expect_equal(seq2ngrams(seqs, 3, 1L:4, d = c(0, 1)), structure(c("4.1.1_0.1",
     "2.1.3_0.1", "1.4.1_0.1", "1.3.1_0.1"), .Dim = c(2L,
     2L)))
     expect_equal(seq2ngrams(seqs, 3, 1L:4, d = 1), structure(c("4.4.1_1.1",
     "2.3.1_1.1"), .Dim = c(2L, 1L)))
     expect_true(all(sapply(seq2ngrams(sample(1L:4, 20, replace = TRUE),
     3, 1L:4), is_ngram)))
     expect_true(all(sapply(seq2ngrams(sample(c("a", "c", "g",
     "t"), 20, replace = TRUE), 3, c("a", "c", "g", "t")),
     is_ngram)))
     })
     where 17: eval(code, test_env)
     where 18: eval(code, test_env)
     where 19: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 20: doTryCatch(return(expr), name, parentenv, handler)
     where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 25: tryCatchList(expr, classes, parentenv, handlers)
     where 26: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 27: test_code(NULL, exprs, env)
     where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 29: force(code)
     where 30: doWithOneRestart(return(expr), restart)
     where 31: withOneRestart(expr, restarts[[1L]])
     where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 34: FUN(X[[i]], ...)
     where 35: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 36: force(code)
     where 37: doWithOneRestart(return(expr), restart)
     where 38: withOneRestart(expr, restarts[[1L]])
     where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 40: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 43: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 44: test_check("biogram")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (seq, n, u, d = 0, pos = FALSE)
     {
     if (!(is.matrix(seq) || is.vector(seq)))
     stop("'seq' must be vector or matrix.")
     if (class(seq) != "matrix")
     seq <- matrix(seq, nrow = 1)
     len_seq <- ncol(seq)
     n_seqs <- nrow(seq)
     ngram_ind <- get_ngrams_ind(len_seq, n, d)
     max_grams <- calc_max_grams(len_seq, n, ngram_ind)
     res <- t(vapply(1L:n_seqs, function(i) {
     grams <- seq2ngrams_helper(seq[i, ], ind = ngram_ind,
     max_grams)
     paste(grams, paste0(attr(ngram_ind, "d"), collapse = "."),
     sep = "_")
     }, rep("a", max_grams)))
     if (max_grams == 1)
     res <- t(res)
     if (pos)
     res <- do.call(cbind, lapply(1L:ncol(res), function(pos_id) paste0(pos_id,
     "_", res[, pos_id])))
     res
     }
     <bytecode: 0x26e4a90>
     <environment: namespace:biogram>
     --- function search by body ---
     Function seq2ngrams in namespace biogram has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 2. Error: Extract ngrams for different distances (@test_seq2grams.R#6) -----
     the condition has length > 1
     Backtrace:
     1. testthat::expect_equal(...)
     4. biogram::seq2ngrams(seqs, 3, 1L:4)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     biogram
     --- call from context ---
     count_specified(seq, ngrams)
     --- call from argument ---
     if (class(seq) != "matrix") seq <- matrix(seq, nrow = 1)
     --- R stacktrace ---
     where 1: count_specified(seq, ngrams)
     where 2: as.matrix(count_specified(seq, ngrams))
     where 3: table_ngrams(human_cleave[, -10], c("15.15_0", "11.11_0"), human_cleave[,
     10])
     where 4: eval_bare(expr, quo_get_env(quo))
     where 5: quasi_label(enquo(object), label, arg = "object")
     where 6 at testthat/test_table_ngrams.R#7: expect_identical(table_ngrams(human_cleave[, -10], c("15.15_0",
     "11.11_0"), human_cleave[, 10])[["target1"]], c(5, 0))
     where 7: eval(code, test_env)
     where 8: eval(code, test_env)
     where 9: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 10: doTryCatch(return(expr), name, parentenv, handler)
     where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 17: test_code(desc, code, env = parent.frame())
     where 18 at testthat/test_table_ngrams.R#3: test_that("tabulating unpositioned n-grams", {
     data(human_cleave)
     expect_identical(table_ngrams(human_cleave[, -10], c("15.15_0",
     "11.11_0"), human_cleave[, 10])[["target1"]], c(5, 0))
     })
     where 19: eval(code, test_env)
     where 20: eval(code, test_env)
     where 21: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 22: doTryCatch(return(expr), name, parentenv, handler)
     where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 25: doTryCatch(return(expr), name, parentenv, handler)
     where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 27: tryCatchList(expr, classes, parentenv, handlers)
     where 28: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 29: test_code(NULL, exprs, env)
     where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 31: force(code)
     where 32: doWithOneRestart(return(expr), restart)
     where 33: withOneRestart(expr, restarts[[1L]])
     where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 36: FUN(X[[i]], ...)
     where 37: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 38: force(code)
     where 39: doWithOneRestart(return(expr), restart)
     where 40: withOneRestart(expr, restarts[[1L]])
     where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 42: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 45: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 46: test_check("biogram")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (seq, ngrams)
     {
     validated_ngram <- sapply(ngrams, is_ngram)
     if (!all(validated_ngram))
     stop("Improper n-grams: ", paste(names(which(!validated_ngram)),
     collapse = ", "))
     if (class(seq) != "matrix")
     seq <- matrix(seq, nrow = 1)
     len_seq <- ncol(seq)
     n_seqs <- nrow(seq)
     df <- ngrams2df(ngrams)
     sn_grams <- strsplit(df[, "ngram"], ".", fixed = TRUE)
     ngrams_list <- lapply(1L:nrow(df), function(single_ngram) list(ngram = strsplit(df[single_ngram,
     "ngram"], ".", fixed = TRUE)[[1]], distance = as.numeric(strsplit(df[single_ngram,
     "distance"], ".", fixed = TRUE)[[1]])))
     if (ncol(df) == 3)
     ngrams_list <- lapply(1L:nrow(df), function(single_ngram) c(ngrams_list[[single_ngram]],
     position = as.numeric(df[single_ngram, "position"])))
     names(ngrams_list) <- ngrams
     res <- if (ncol(df) == 3) {
     vapply(ngrams_list, function(single_ngram) count_single_positioned_ngram(single_ngram,
     seq, len_seq), rep(0, nrow(seq)))
     }
     else {
     vapply(ngrams_list, function(single_ngram) count_single_unpositioned_ngram(single_ngram,
     seq, len_seq), rep(0, nrow(seq)))
     }
     if (class(res) == "numeric") {
     res <- matrix(res, ncol = 1)
     }
     colnames(res) <- ngrams
     as.simple_triplet_matrix(res)
     }
     <bytecode: 0x270ce70>
     <environment: namespace:biogram>
     --- function search by body ---
     Function count_specified in namespace biogram has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 3. Error: tabulating unpositioned n-grams (@test_table_ngrams.R#7) ---------
     the condition has length > 1
     Backtrace:
     1. testthat::expect_identical(...)
     4. biogram::table_ngrams(...)
     6. biogram::count_specified(seq, ngrams)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     biogram
     --- call from context ---
     count_specified(seq, ngrams)
     --- call from argument ---
     if (class(seq) != "matrix") seq <- matrix(seq, nrow = 1)
     --- R stacktrace ---
     where 1: count_specified(seq, ngrams)
     where 2: as.matrix(count_specified(seq, ngrams))
     where 3: table_ngrams(human_cleave[, -10], c("1_15.15_0", "1_11.11_0"),
     human_cleave[, 10])
     where 4: eval_bare(expr, quo_get_env(quo))
     where 5: quasi_label(enquo(object), label, arg = "object")
     where 6 at testthat/test_table_ngrams.R#15: expect_identical(table_ngrams(human_cleave[, -10], c("1_15.15_0",
     "1_11.11_0"), human_cleave[, 10])[["target1"]], c(2, 0))
     where 7: eval(code, test_env)
     where 8: eval(code, test_env)
     where 9: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 10: doTryCatch(return(expr), name, parentenv, handler)
     where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 17: test_code(desc, code, env = parent.frame())
     where 18 at testthat/test_table_ngrams.R#11: test_that("tabulating positioned n-grams", {
     data(human_cleave)
     expect_identical(table_ngrams(human_cleave[, -10], c("1_15.15_0",
     "1_11.11_0"), human_cleave[, 10])[["target1"]], c(2,
     0))
     })
     where 19: eval(code, test_env)
     where 20: eval(code, test_env)
     where 21: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 22: doTryCatch(return(expr), name, parentenv, handler)
     where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 25: doTryCatch(return(expr), name, parentenv, handler)
     where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 27: tryCatchList(expr, classes, parentenv, handlers)
     where 28: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 29: test_code(NULL, exprs, env)
     where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 31: force(code)
     where 32: doWithOneRestart(return(expr), restart)
     where 33: withOneRestart(expr, restarts[[1L]])
     where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 36: FUN(X[[i]], ...)
     where 37: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 38: force(code)
     where 39: doWithOneRestart(return(expr), restart)
     where 40: withOneRestart(expr, restarts[[1L]])
     where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 42: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 45: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 46: test_check("biogram")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (seq, ngrams)
     {
     validated_ngram <- sapply(ngrams, is_ngram)
     if (!all(validated_ngram))
     stop("Improper n-grams: ", paste(names(which(!validated_ngram)),
     collapse = ", "))
     if (class(seq) != "matrix")
     seq <- matrix(seq, nrow = 1)
     len_seq <- ncol(seq)
     n_seqs <- nrow(seq)
     df <- ngrams2df(ngrams)
     sn_grams <- strsplit(df[, "ngram"], ".", fixed = TRUE)
     ngrams_list <- lapply(1L:nrow(df), function(single_ngram) list(ngram = strsplit(df[single_ngram,
     "ngram"], ".", fixed = TRUE)[[1]], distance = as.numeric(strsplit(df[single_ngram,
     "distance"], ".", fixed = TRUE)[[1]])))
     if (ncol(df) == 3)
     ngrams_list <- lapply(1L:nrow(df), function(single_ngram) c(ngrams_list[[single_ngram]],
     position = as.numeric(df[single_ngram, "position"])))
     names(ngrams_list) <- ngrams
     res <- if (ncol(df) == 3) {
     vapply(ngrams_list, function(single_ngram) count_single_positioned_ngram(single_ngram,
     seq, len_seq), rep(0, nrow(seq)))
     }
     else {
     vapply(ngrams_list, function(single_ngram) count_single_unpositioned_ngram(single_ngram,
     seq, len_seq), rep(0, nrow(seq)))
     }
     if (class(res) == "numeric") {
     res <- matrix(res, ncol = 1)
     }
     colnames(res) <- ngrams
     as.simple_triplet_matrix(res)
     }
     <bytecode: 0x270ce70>
     <environment: namespace:biogram>
     --- function search by body ---
     Function count_specified in namespace biogram has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 4. Error: tabulating positioned n-grams (@test_table_ngrams.R#15) ----------
     the condition has length > 1
     Backtrace:
     1. testthat::expect_identical(...)
     4. biogram::table_ngrams(...)
     6. biogram::count_specified(seq, ngrams)
    
     == testthat results ===========================================================
     [ OK: 33 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 4 ]
     1. Error: Exact test and permutation test are consistent (@test_quipt_consistency.R#8)
     2. Error: Extract ngrams for different distances (@test_seq2grams.R#6)
     3. Error: tabulating unpositioned n-grams (@test_table_ngrams.R#7)
     4. Error: tabulating positioned n-grams (@test_table_ngrams.R#15)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang