ropensci / bold

Interface to the Bold Systems barcode webservice
https://docs.ropensci.org/bold
Other
17 stars 11 forks source link

_R_CHECK_LENGTH_1_LOGIC2_ R-devel error #57

Closed sckott closed 5 years ago

sckott commented 5 years ago

from taxize::bold_search test

1. Error: bold_search returns the correct value, dimensions, and classes (@te
'length(x) = 2 > 1' in coercion to 'logical(1)'
1: vcr::use_cassette("bold_search", {
       a <- bold_search(name = "Apis")
       b <- bold_search(name = "Aga", fuzzy = TRUE)
       c <- bold_search(name = c("Apis", "Puma concolor"))
       d <- bold_search(id = 88899)
   }) at testthat/test-bold_search.R:4
2: cassette$call_block(...)
3: lazyeval::lazy_eval(tmp)
4: lapply(x, lazy_eval, data = data)
5: FUN(X[[i]], ...)
6: eval(x$expr, x$env, emptyenv())
7: eval(x$expr, x$env, emptyenv())
8: bold_search(name = "Apis") at testthat/test-bold_search.R:5
9: bold_tax_name(name = name, fuzzy = fuzzy, response = response, ...)
10: data.table::setDF(data.table::rbindlist(Map(process_tax_name, tmp, name), use.names = TRUE, 
       fill = TRUE))
11: data.table::rbindlist(Map(process_tax_name, tmp, name), use.names = TRUE, fill = TRUE)
12: Map(process_tax_name, tmp, name)
13: mapply(FUN = f, ..., SIMPLIFY = FALSE)
14: (function (x, y) 
   {
       tt <- rawToChar(x$content)
       out <- if (x$status_code > 202) 
           "stop"
       else jsonlite::fromJSON(tt, flatten = TRUE)
       if (length(out) == 0 || identical(out[[1]], list()) || out == "stop") {
           data.frame(input = y, stringsAsFactors = FALSE)
       }
       else {
           data.frame(out$top_matched_names, input = y, stringsAsFactors = FALSE)
       }
   })(dots[[1L]][[1L]], dots[[2L]][[1L]])
sckott commented 5 years ago

another:

28. Error: works with get_*() input (@test-tax_rank.R#26)
'length(x) = 2 > 1' in coercion to 'logical(1)'
1: vcr::use_cassette("tax_rank_get_star_input", {
       aa <- suppressMessages(tax_rank(get_boldid("Helianthus annuus")))
   }) at testthat/test-tax_rank.R:26
2: cassette$call_block(...)
3: lazyeval::lazy_eval(tmp)
4: lapply(x, lazy_eval, data = data)
5: FUN(X[[i]], ...)
6: eval(x$expr, x$env, emptyenv())
7: eval(x$expr, x$env, emptyenv())
8: suppressMessages(tax_rank(get_boldid("Helianthus annuus"))) at testthat/test-tax_rank.R:27
9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
10: tax_rank(get_boldid("Helianthus annuus"))
...
14: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
15: lapply(pieces, .fun, ...)
16: FUN(X[[i]], ...)
17: bold_search(name = x, fuzzy = fuzzy, dataTypes = dataTypes, includeTree = includeTree, 
       ...)
18: bold_tax_name(name = name, fuzzy = fuzzy, response = response, ...)
19: data.table::setDF(data.table::rbindlist(Map(process_tax_name, tmp, name), use.names = TRUE, 
       fill = TRUE))
20: data.table::rbindlist(Map(process_tax_name, tmp, name), use.names = TRUE, fill = TRUE)
21: Map(process_tax_name, tmp, name)
22: mapply(FUN = f, ..., SIMPLIFY = FALSE)
23: (function (x, y) 
   {
       tt <- rawToChar(x$content)
       out <- if (x$status_code > 202) 
           "stop"
       else jsonlite::fromJSON(tt, flatten = TRUE)
       if (length(out) == 0 || identical(out[[1]], list()) || out == "stop") {
           data.frame(input = y, stringsAsFactors = FALSE)
       }
       else {
           data.frame(out$top_matched_names, input = y, stringsAsFactors = FALSE)
       }
   })(dots[[1L]][[1L]], dots[[2L]][[1L]])
sckott commented 5 years ago

already fixed in 84527d8475573765c5bd110b9a5b6577b3d9a541