Last updated on 2024-10-05 03:49:23 CEST.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 0.5.3 | 7.51 | 64.64 | 72.15 | ERROR | |
r-devel-linux-x86_64-debian-gcc | 0.5.3 | 5.24 | 46.34 | 51.58 | ERROR | |
r-devel-linux-x86_64-fedora-clang | 0.5.3 | 114.94 | OK | |||
r-devel-linux-x86_64-fedora-gcc | 0.5.3 | 119.53 | OK | |||
r-devel-windows-x86_64 | 0.5.3 | 13.00 | 109.00 | 122.00 | ERROR | |
r-patched-linux-x86_64 | 0.5.3 | 7.37 | 62.55 | 69.92 | OK | |
r-release-linux-x86_64 | 0.5.3 | 6.77 | 60.85 | 67.62 | ERROR | |
r-release-macos-arm64 | 0.5.3 | 74.00 | OK | |||
r-release-macos-x86_64 | 0.5.3 | 141.00 | OK | |||
r-release-windows-x86_64 | 0.5.3 | 11.00 | 108.00 | 119.00 | ERROR | |
r-oldrel-macos-arm64 | 0.5.3 | 77.00 | OK | |||
r-oldrel-macos-x86_64 | 0.5.3 | 126.00 | OK | |||
r-oldrel-windows-x86_64 | 0.5.3 | 15.00 | 119.00 | 134.00 | ERROR |
Version: 0.5.3
Check: examples
Result: ERROR
Running examples in ‘fqar-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: species_acronym
> ### Title: Acronym of a species in a specified database
> ### Aliases: species_acronym
>
> ### ** Examples
>
> species_acronym("Anemone canadensis", database_id = 149)
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-release-linux-x86_64
Version: 0.5.3
Check: tests
Result: ERROR
Running ‘testthat.R’ [11s/33s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(fqar)
>
> test_check("fqar")
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-download_database.R:10:3'): download_database works ────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_message(download_database(3)) at test-download_database.R:10:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─testthat:::quasi_capture(...)
4. │ ├─testthat (local) .capture(...)
5. │ │ └─base::withCallingHandlers(...)
6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
7. └─fqar::download_database(3)
8. ├─fqar:::download_database_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-species_acronym.R:14:3'): species_acronym works ────────────────
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Backtrace:
▆
1. ├─base::suppressMessages(download_database(149)) at test-species_acronym.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(149)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. └─jsonlite::fromJSON(database_text)
10. └─jsonlite:::parse_and_simplify(...)
11. └─jsonlite:::parseJSON(txt, bigint_as_char)
12. └─jsonlite:::parse_string(txt, bigint_as_char)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
Error: Test failures
Execution halted
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.5.3
Check: tests
Result: ERROR
Running ‘testthat.R’ [7s/28s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(fqar)
>
> test_check("fqar")
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-download_database.R:10:3'): download_database works ────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_message(download_database(3)) at test-download_database.R:10:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─testthat:::quasi_capture(...)
4. │ ├─testthat (local) .capture(...)
5. │ │ └─base::withCallingHandlers(...)
6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
7. └─fqar::download_database(3)
8. ├─fqar:::download_database_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-species_acronym.R:14:3'): species_acronym works ────────────────
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Backtrace:
▆
1. ├─base::suppressMessages(download_database(149)) at test-species_acronym.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(149)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. └─jsonlite::fromJSON(database_text)
10. └─jsonlite:::parse_and_simplify(...)
11. └─jsonlite:::parseJSON(txt, bigint_as_char)
12. └─jsonlite:::parse_string(txt, bigint_as_char)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
Error: Test failures
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.5.3
Check: examples
Result: ERROR
Running examples in 'fqar-Ex.R' failed
The error most likely occurred in:
> ### Name: database_glance
> ### Title: Obtain tidy summary information for a floristic quality database
> ### Aliases: database_glance
>
> ### ** Examples
>
> # While database_glance can be used with a .csv file downloaded manually
> # from the universal FQA website, it is most typically used in combination
> # with download_database().
>
> chicago_db <- download_database(database_id = 1)
Error in (function (database_id) : object 'assessments_get' not found
Calls: download_database ... eval -> <Anonymous> -> message -> paste -> <Anonymous>
Execution halted
Flavor: r-devel-windows-x86_64
Version: 0.5.3
Check: tests
Result: ERROR
Running 'testthat.R' [30s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(fqar)
>
> test_check("fqar")
[ FAIL 24 | WARN 0 | SKIP 0 | PASS 231 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-database_glance.R:17:3'): database_glance works ────────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(1)) at test-database_glance.R:17:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(1)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-download_database.R:10:3'): download_database works ────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_message(download_database(3)) at test-download_database.R:10:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─testthat:::quasi_capture(...)
4. │ ├─testthat (local) .capture(...)
5. │ │ └─base::withCallingHandlers(...)
6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
7. └─fqar::download_database(3)
8. ├─fqar:::download_database_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-download_database_internal.R:10:3'): download_database_internal works ──
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = 1)`: object 'assessments_get' not found
Backtrace:
▆
1. └─fqar (local) `<fn>`(database_id = 1)
2. ├─base::message(...)
3. ├─base::paste(...)
4. └─httr::status_code(assessments_get)
── Error ('test-download_transect.R:10:3'): download_transect works ────────────
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(6322)) at test-download_transect.R:10:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(6322)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-download_transect_internal.R:10:3'): download_transect_internal works ──
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = 6322)`: object 'assessments_get' not found
Backtrace:
▆
1. └─fqar (local) `<fn>`(transect_id = 6322)
2. ├─base::message(...)
3. ├─base::paste(...)
4. └─httr::status_code(assessments_get)
── Error ('test-download_transect_list.R:3:3'): download_transect_list works ───
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
empty_df <- data.frame(id = numeric(0), assessment = character(0),
date = numeric(0), site = character(0), practitioner = character(0))
class(empty_df) <- c("tbl_df", "tbl", "data.frame")
empty_df$date <- as.Date(empty_df$date)
if (database_id == -40000) {
return(invisible(empty_df))
}
trans_address <- paste0("http://universalfqa.org/get/database/",
database_id, "/transect")
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty_df))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty_df))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
transect_summary <- as.data.frame(list_data)
if (nrow(transect_summary) == 0) {
message("No data associated with specified database_id.")
return(invisible(empty_df))
}
colnames(transect_summary) <- c("id", "assessment", "date",
"site", "practitioner")
transect_summary$id <- as.double(transect_summary$id)
transect_summary$date[transect_summary$date == "0000-00-00"] <- NA
transect_summary$date <- as.Date(transect_summary$date)
class(transect_summary) <- c("tbl_df", "tbl", "data.frame")
transect_summary
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_equal(...) at test-download_transect_list.R:3:3
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. ├─base::suppressMessages(download_transect_list(-2))
5. │ └─base::withCallingHandlers(...)
6. └─fqar::download_transect_list(-2)
7. └─fqar::index_fqa_transects(database_id)
8. ├─fqar:::index_fqa_transects_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-index_fqa_databases.R:5:3'): index_fqa_databases works ─────────
Error in `(function ()
{
empty_df <- data.frame(database_id = numeric(0), region = character(0),
year = numeric(0), description = character(0))
class(empty_df) <- c("tbl_df", "tbl", "data.frame")
databases_address <- "http://universalfqa.org/get/database/"
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
databases_get <- tryCatch(httr::GET(databases_address, ua,
timeout(2)), error = function(e) {
message("No response from UniversalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(databases_get)
if (cl != "response") {
return(invisible(empty_df))
}
if (httr::http_error(databases_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty_df))
}
databases_text <- httr::content(databases_get, "text", encoding = "ISO-8859-1")
databases_json <- jsonlite::fromJSON(databases_text)
list_data <- databases_json[[2]]
databases <- as.data.frame(list_data)
databases[, c(1, 3)] <- lapply(databases[, c(1, 3)], as.double)
colnames(databases) <- c("database_id", "region", "year",
"description")
class(databases) <- c("tbl_df", "tbl", "data.frame")
databases
})()`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(index_fqa_databases()) at test-index_fqa_databases.R:5:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::index_fqa_databases()
4. ├─fqar:::index_fqa_databases_internal()
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`()
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-index_fqa_databases_internal.R:5:3'): index_fqa_databases_internal works ──
Error in `(function ()
{
empty_df <- data.frame(database_id = numeric(0), region = character(0),
year = numeric(0), description = character(0))
class(empty_df) <- c("tbl_df", "tbl", "data.frame")
databases_address <- "http://universalfqa.org/get/database/"
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
databases_get <- tryCatch(httr::GET(databases_address, ua,
timeout(2)), error = function(e) {
message("No response from UniversalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(databases_get)
if (cl != "response") {
return(invisible(empty_df))
}
if (httr::http_error(databases_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty_df))
}
databases_text <- httr::content(databases_get, "text", encoding = "ISO-8859-1")
databases_json <- jsonlite::fromJSON(databases_text)
list_data <- databases_json[[2]]
databases <- as.data.frame(list_data)
databases[, c(1, 3)] <- lapply(databases[, c(1, 3)], as.double)
colnames(databases) <- c("database_id", "region", "year",
"description")
class(databases) <- c("tbl_df", "tbl", "data.frame")
databases
})()`: object 'assessments_get' not found
Backtrace:
▆
1. └─fqar (local) `<fn>`()
2. ├─base::message(...)
3. ├─base::paste(...)
4. └─httr::status_code(assessments_get)
── Error ('test-index_fqa_transects.R:11:3'): index_fqa_transects works ────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
empty_df <- data.frame(id = numeric(0), assessment = character(0),
date = numeric(0), site = character(0), practitioner = character(0))
class(empty_df) <- c("tbl_df", "tbl", "data.frame")
empty_df$date <- as.Date(empty_df$date)
if (database_id == -40000) {
return(invisible(empty_df))
}
trans_address <- paste0("http://universalfqa.org/get/database/",
database_id, "/transect")
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty_df))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty_df))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
transect_summary <- as.data.frame(list_data)
if (nrow(transect_summary) == 0) {
message("No data associated with specified database_id.")
return(invisible(empty_df))
}
colnames(transect_summary) <- c("id", "assessment", "date",
"site", "practitioner")
transect_summary$id <- as.double(transect_summary$id)
transect_summary$date[transect_summary$date == "0000-00-00"] <- NA
transect_summary$date <- as.Date(transect_summary$date)
class(transect_summary) <- c("tbl_df", "tbl", "data.frame")
transect_summary
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(index_fqa_transects(1)) at test-index_fqa_transects.R:11:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::index_fqa_transects(1)
4. ├─fqar:::index_fqa_transects_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-index_fqa_transects_internal.R:11:3'): index_fqa_transects_internal works ──
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
empty_df <- data.frame(id = numeric(0), assessment = character(0),
date = numeric(0), site = character(0), practitioner = character(0))
class(empty_df) <- c("tbl_df", "tbl", "data.frame")
empty_df$date <- as.Date(empty_df$date)
if (database_id == -40000) {
return(invisible(empty_df))
}
trans_address <- paste0("http://universalfqa.org/get/database/",
database_id, "/transect")
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty_df))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty_df))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
transect_summary <- as.data.frame(list_data)
if (nrow(transect_summary) == 0) {
message("No data associated with specified database_id.")
return(invisible(empty_df))
}
colnames(transect_summary) <- c("id", "assessment", "date",
"site", "practitioner")
transect_summary$id <- as.double(transect_summary$id)
transect_summary$date[transect_summary$date == "0000-00-00"] <- NA
transect_summary$date <- as.Date(transect_summary$date)
class(transect_summary) <- c("tbl_df", "tbl", "data.frame")
transect_summary
})(database_id = 1)`: object 'assessments_get' not found
Backtrace:
▆
1. └─fqar (local) `<fn>`(database_id = 1)
2. ├─base::message(...)
3. ├─base::paste(...)
4. └─httr::status_code(assessments_get)
── Error ('test-is_transect.R:10:3'): is_transect works ────────────────────────
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(4492)) at test-is_transect.R:10:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(4492)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-is_transect_list.R:3:3'): is_transect_list works ───────────────
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(4492)) at test-is_transect_list.R:3:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(4492)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-species_acronym.R:14:3'): species_acronym works ────────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(149)) at test-species_acronym.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(149)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-species_c.R:17:3'): species_c works ────────────────────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(1)) at test-species_c.R:17:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(1)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-species_common_name.R:14:3'): species_common_name works ────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(1)) at test-species_common_name.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(1)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-species_nativity.R:14:3'): species_nativity works ──────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(1)) at test-species_nativity.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(1)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-species_phys.R:15:3'): species_phys works ──────────────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(1)) at test-species_phys.R:15:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(1)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-species_w.R:13:3'): species_w works ────────────────────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_database(1)) at test-species_w.R:13:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(1)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-transect_glance.R:16:3'): transect_glance works ────────────────
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(4492)) at test-transect_glance.R:16:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(4492)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-transect_inventory.R:16:3'): transect_inventory works ──────────
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(4492)) at test-transect_inventory.R:16:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(4492)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-transect_list_glance.R:14:3'): transect_list_glance works ──────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer corresponding to an existing FQA database. Use index_fqa_databases() to obtain a data frame of valid options.",
call. = FALSE)
}
empty_df <- data.frame(id = numeric(0), assessment = character(0),
date = numeric(0), site = character(0), practitioner = character(0))
class(empty_df) <- c("tbl_df", "tbl", "data.frame")
empty_df$date <- as.Date(empty_df$date)
if (database_id == -40000) {
return(invisible(empty_df))
}
trans_address <- paste0("http://universalfqa.org/get/database/",
database_id, "/transect")
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty_df))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty_df))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
transect_summary <- as.data.frame(list_data)
if (nrow(transect_summary) == 0) {
message("No data associated with specified database_id.")
return(invisible(empty_df))
}
colnames(transect_summary) <- c("id", "assessment", "date",
"site", "practitioner")
transect_summary$id <- as.double(transect_summary$id)
transect_summary$date[transect_summary$date == "0000-00-00"] <- NA
transect_summary$date <- as.Date(transect_summary$date)
class(transect_summary) <- c("tbl_df", "tbl", "data.frame")
transect_summary
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect_list(63, id %in% test_vec)) at test-transect_list_glance.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect_list(63, id %in% test_vec)
4. └─fqar::index_fqa_transects(database_id)
5. ├─fqar:::index_fqa_transects_internal(database_id)
6. │ ├─base::withVisible(eval(mc, parent.frame()))
7. │ └─base::eval(mc, parent.frame())
8. │ └─base::eval(mc, parent.frame())
9. └─fqar (local) `<fn>`(database_id = database_id)
10. ├─base::message(...)
11. ├─base::paste(...)
12. └─httr::status_code(assessments_get)
── Error ('test-transect_list_inventory.R:9:3'): transect_list_inventory works ──
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(4492)) at test-transect_list_inventory.R:9:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(4492)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-transect_phys.R:11:3'): transect_phys works ────────────────────
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(4492)) at test-transect_phys.R:11:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(4492)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
── Error ('test-transect_subplot_inventories.R:6:3'): transect_subplot_inventories works ──
Error in `(function (transect_id)
{
if (!is.numeric(transect_id)) {
stop("transect_id must be an integer.", call. = FALSE)
}
if (transect_id%%1 != 0) {
stop("transect_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0), V10 = character(0), V11 = character(0),
V12 = character(0), V13 = character(0), V14 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (transect_id == -40000) {
return(invisible(empty))
}
trans_address <- paste0("http://universalfqa.org/get/transect/",
transect_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
trans_get <- tryCatch(httr::GET(trans_address, ua, timeout(2)),
error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(trans_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(trans_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
trans_text <- httr::content(trans_get, "text", encoding = "ISO-8859-1")
trans_json <- jsonlite::fromJSON(trans_text)
list_data <- trans_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
out <- as.data.frame(do.call(rbind, list_data))
class(out) <- c("tbl_df", "tbl", "data.frame")
out
})(transect_id = transect_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─base::suppressMessages(download_transect(5932)) at test-transect_subplot_inventories.R:6:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_transect(5932)
4. ├─fqar:::download_transect_internal(transect_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(transect_id = transect_id)
9. ├─base::message(...)
10. ├─base::paste(...)
11. └─httr::status_code(assessments_get)
[ FAIL 24 | WARN 0 | SKIP 0 | PASS 231 ]
Error: Test failures
Execution halted
Flavor: r-devel-windows-x86_64
Version: 0.5.3
Check: tests
Result: ERROR
Running ‘testthat.R’ [10s/32s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(fqar)
>
> test_check("fqar")
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-download_database.R:10:3'): download_database works ────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_message(download_database(3)) at test-download_database.R:10:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─testthat:::quasi_capture(...)
4. │ ├─testthat (local) .capture(...)
5. │ │ └─base::withCallingHandlers(...)
6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
7. └─fqar::download_database(3)
8. ├─fqar:::download_database_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-species_acronym.R:14:3'): species_acronym works ────────────────
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Backtrace:
▆
1. ├─base::suppressMessages(download_database(149)) at test-species_acronym.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(149)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. └─jsonlite::fromJSON(database_text)
10. └─jsonlite:::parse_and_simplify(...)
11. └─jsonlite:::parseJSON(txt, bigint_as_char)
12. └─jsonlite:::parse_string(txt, bigint_as_char)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
Error: Test failures
Execution halted
Flavor: r-release-linux-x86_64
Version: 0.5.3
Check: examples
Result: ERROR
Running examples in 'fqar-Ex.R' failed
The error most likely occurred in:
> ### Name: species_acronym
> ### Title: Acronym of a species in a specified database
> ### Aliases: species_acronym
>
> ### ** Examples
>
> species_acronym("Anemone canadensis", database_id = 149)
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Execution halted
Flavors: r-release-windows-x86_64, r-oldrel-windows-x86_64
Version: 0.5.3
Check: tests
Result: ERROR
Running 'testthat.R' [28s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(fqar)
>
> test_check("fqar")
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 358 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-download_database.R:10:3'): download_database works ────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_message(download_database(3)) at test-download_database.R:10:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─testthat:::quasi_capture(...)
4. │ ├─testthat (local) .capture(...)
5. │ │ └─base::withCallingHandlers(...)
6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
7. └─fqar::download_database(3)
8. ├─fqar:::download_database_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-species_acronym.R:14:3'): species_acronym works ────────────────
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Backtrace:
▆
1. ├─base::suppressMessages(download_database(149)) at test-species_acronym.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(149)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. └─jsonlite::fromJSON(database_text)
10. └─jsonlite:::parse_and_simplify(...)
11. └─jsonlite:::parseJSON(txt, bigint_as_char)
12. └─jsonlite:::parse_string(txt, bigint_as_char)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 358 ]
Error: Test failures
Execution halted
Flavor: r-release-windows-x86_64
Version: 0.5.3
Check: tests
Result: ERROR
Running 'testthat.R' [31s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(fqar)
>
> test_check("fqar")
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
data_set must be a dataframe obtained from the universalFQA.org website. Type ?download_transect for help.
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-download_database.R:10:3'): download_database works ────────────
Error in `(function (database_id)
{
if (!is.numeric(database_id)) {
stop("database_id must be an integer.", call. = FALSE)
}
if (database_id%%1 != 0) {
stop("database_id must be an integer.", call. = FALSE)
}
empty <- data.frame(V1 = character(0), V2 = character(0),
V3 = character(0), V4 = character(0), V5 = character(0),
V6 = character(0), V7 = character(0), V8 = character(0),
V9 = character(0))
class(empty) <- c("tbl_df", "tbl", "data.frame")
if (database_id == -40000) {
return(invisible(empty))
}
database_address <- paste0("http://universalfqa.org/get/database/",
database_id)
ua <- httr::user_agent("https://github.com/equitable-equations/fqar")
database_get <- tryCatch(httr::GET(database_address, ua,
timeout(2)), error = function(e) {
message("No response from universalFQA.org. Please check internet connection.")
character(0)
})
cl <- class(database_get)
if (cl != "response") {
return(invisible(empty))
}
if (httr::http_error(database_get)) {
message(paste("API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)))
return(invisible(empty))
}
database_text <- httr::content(database_get, "text", encoding = "ISO-8859-1")
database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]
if ((list_data[[1]] == "The requested assessment is not public") &
(!is.na(list_data[[1]]))) {
message("The requested assessment is not public.")
return(invisible(empty))
}
max_length <- max(unlist(lapply(list_data, length)))
list_data <- lapply(list_data, function(x) {
length(x) <- max_length
unlist(x)
})
db_out <- as.data.frame(do.call(rbind, list_data))
if (db_out[5, 2] == 0) {
message("Specified database is empty.")
}
class(db_out) <- c("tbl_df", "tbl", "data.frame")
db_out
})(database_id = database_id)`: object 'assessments_get' not found
Backtrace:
▆
1. ├─testthat::expect_message(download_database(3)) at test-download_database.R:10:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─testthat:::quasi_capture(...)
4. │ ├─testthat (local) .capture(...)
5. │ │ └─base::withCallingHandlers(...)
6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
7. └─fqar::download_database(3)
8. ├─fqar:::download_database_internal(database_id)
9. │ ├─base::withVisible(eval(mc, parent.frame()))
10. │ └─base::eval(mc, parent.frame())
11. │ └─base::eval(mc, parent.frame())
12. └─fqar (local) `<fn>`(database_id = database_id)
13. ├─base::message(...)
14. ├─base::paste(...)
15. └─httr::status_code(assessments_get)
── Error ('test-species_acronym.R:14:3'): species_acronym works ────────────────
Error: parse error: unallowed token at this point in JSON text
tatus" : "success", "data" : }
(right here) ------^
Backtrace:
▆
1. ├─base::suppressMessages(download_database(149)) at test-species_acronym.R:14:3
2. │ └─base::withCallingHandlers(...)
3. └─fqar::download_database(149)
4. ├─fqar:::download_database_internal(database_id)
5. │ ├─base::withVisible(eval(mc, parent.frame()))
6. │ └─base::eval(mc, parent.frame())
7. │ └─base::eval(mc, parent.frame())
8. └─fqar (local) `<fn>`(database_id = database_id)
9. └─jsonlite::fromJSON(database_text)
10. └─jsonlite:::parse_and_simplify(...)
11. └─jsonlite:::parseJSON(txt, bigint_as_char)
12. └─jsonlite:::parse_string(txt, bigint_as_char)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 363 ]
Error: Test failures
Execution halted
Flavor: r-oldrel-windows-x86_64