CRAN Package Check Results for Package openalexR

Last updated on 2025-04-29 01:49:42 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.0.0 2.88 31.75 34.63 OK
r-devel-linux-x86_64-debian-gcc 2.0.0 2.02 25.94 27.96 ERROR
r-devel-linux-x86_64-fedora-clang 2.0.0 56.77 OK
r-devel-linux-x86_64-fedora-gcc 2.0.0 52.98 OK
r-devel-windows-x86_64 2.0.0 4.00 67.00 71.00 OK
r-patched-linux-x86_64 2.0.0 3.98 31.37 35.35 OK
r-release-linux-x86_64 2.0.0 3.08 31.58 34.66 OK
r-release-macos-arm64 2.0.0 28.00 OK
r-release-macos-x86_64 2.0.0 49.00 OK
r-release-windows-x86_64 2.0.0 5.00 69.00 74.00 OK
r-oldrel-macos-arm64 2.0.0 33.00 OK
r-oldrel-macos-x86_64 2.0.0 63.00 OK
r-oldrel-windows-x86_64 2.0.0 5.00 73.00 78.00 OK

Check Details

Version: 2.0.0
Check: examples
Result: ERROR Running examples in ‘openalexR-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### 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 511 records... Getting record 2 of 511 records... Getting record 3 of 511 records... [1] "https://openalex.org/W4248184440" [1] "https://openalex.org/W1521059904" [1] "https://openalex.org/W2063977404" [1] "https://openalex.org/W1987736762" [1] "https://openalex.org/W2127626512" [1] "https://openalex.org/W2135732400" Error in res[[result_name]][[j]] : subscript out of bounds Calls: <Anonymous> ... <Anonymous> -> user -> <<- -> env_poke -> eval_bare Execution halted Flavor: r-devel-linux-x86_64-debian-gcc