* using log directory 'd:/Rcompile/CRANpkg/local/4.5/openalexR.Rcheck' * using R Under development (unstable) (2025-03-11 r87944 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 14.2.0 GNU Fortran (GCC) 14.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'openalexR/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'openalexR' version '1.4.0' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'openalexR' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [0s] OK * checking whether the package can be loaded with stated dependencies ... [0s] OK * checking whether the package can be unloaded cleanly ... [0s] OK * checking whether the namespace can be loaded with stated dependencies ... [0s] OK * checking whether the namespace can be unloaded cleanly ... [0s] OK * checking loading without being on the library search path ... [0s] OK * checking whether startup messages can be suppressed ... [0s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [4s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of 'data' directory ... OK * checking data for non-ASCII characters ... [0s] OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... [11s] 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 Error in curl::curl_fetch_memory(url, handle = handle) : Timeout was reached [api.openalex.org]: SSL/TLS connection timeout Calls: oar ... request_fetch.write_memory -> -> raise_libcurl_error Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [3s] OK Running 'testthat.R' [2s] * checking PDF version of manual ... [22s] OK * checking HTML version of manual ... [5s] OK * DONE Status: 1 ERROR