CRAN Package Check Results for Package openalexR

Last updated on 2024-06-29 11:49:19 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.3.1 4.11 39.11 43.22 OK
r-devel-linux-x86_64-debian-gcc 1.3.1 3.04 29.44 32.48 OK
r-devel-linux-x86_64-fedora-clang 1.3.1 53.27 OK
r-devel-linux-x86_64-fedora-gcc 1.3.1 49.75 OK
r-devel-windows-x86_64 1.3.1 5.00 112.00 117.00 ERROR
r-patched-linux-x86_64 1.3.1 3.15 37.89 41.04 OK
r-release-linux-x86_64 1.3.1 3.52 38.47 41.99 OK
r-release-macos-arm64 1.3.1 26.00 OK
r-release-macos-x86_64 1.3.1 36.00 OK
r-release-windows-x86_64 1.3.1 5.00 63.00 68.00 OK
r-oldrel-macos-arm64 1.3.1 29.00 OK
r-oldrel-macos-x86_64 1.3.1 47.00 OK
r-oldrel-windows-x86_64 1.3.1 5.00 71.00 76.00 OK

Check Details

Version: 1.3.1
Check: examples
Result: ERROR Running examples in 'openalexR-Ex.R' failed The error most likely occurred in: > ### Name: oa_generate > ### Title: Iterating through records > ### Aliases: oa_generate > > ### ** Examples > > if (require("coro")) { + # Example 1: basic usage getting one record at a time + query_url <- "https://api.openalex.org/works?filter=cites%3AW1160808132" + oar <- oa_generate(query_url, verbose = TRUE) + p1 <- oar() # record 1 + p2 <- oar() # record 2 + p3 <- oar() # record 3 + head(p1) + head(p3) + + # Example 2: using `coro::loop()` to iterate through the generator + query_url <- "https://api.openalex.org/works?filter=cited_by%3AW1847168837" + oar <- oa_generate(query_url) + coro::loop(for (x in oar) { + print(x$id) + }) + + # Example 3: save records in blocks of 100 + query_url <- "https://api.openalex.org/works?filter=cites%3AW1160808132" + oar <- oa_generate(query_url) + n <- 100 + recs <- vector("list", n) + i <- 0 + + coro::loop(for (x in oar) { + j <- i %% n + 1 + recs[[j]] <- x + if (j == n) { + # saveRDS(recs, sprintf("rec-%s.rds", i %/% n)) + recs <- vector("list", n) # reset recs + } + i <- i + 1 + }) + head(x) + j + # 398 works total, so j = 98 makes sense. + + # You can also manually call the generator until exhausted + # using `while (!coro::is_exhausted(record_i))`. + # More details at https://coro.r-lib.org/articles/generator.html. + + } Loading required package: coro Getting record 1 of 424 records... Getting record 2 of 424 records... Getting record 3 of 424 records... Application Error. Please try setting `per_page = 25` in your function call! NULL Error in curl::curl_fetch_memory(url, handle = handle) : Timeout was reached: [api.openalex.org] SSL/TLS connection timeout Calls: <Anonymous> ... request_fetch -> request_fetch.write_memory -> <Anonymous> Execution halted Flavor: r-devel-windows-x86_64