* using log directory 'd:/Rcompile/CRANpkg/local/4.5/REDCapExporter.Rcheck' * using R version 4.5.2 (2025-10-31 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 14.3.0 GNU Fortran (GCC) 14.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'REDCapExporter/DESCRIPTION' ... OK * this is package 'REDCapExporter' version '0.3.2' * 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 'REDCapExporter' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking 'build' 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 ... [3s] 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 installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... [4s] OK * checking for unstated dependencies in 'tests' ... OK * checking tests ... [8s] ERROR Running 'test-as.data.frame.R' [1s] Running 'test-build_r_pkg.R' [3s] Running 'test-export.R' [3s] Running 'test-format_record.R' [1s] Running 'test-keyring.R' [0s] Running the tests in 'tests/test-export.R' failed. Complete output: > library(REDCapExporter) > > # Tests rely on publicly available REDCap and tokens published > # https://github.com/redcap-tools/redcap-test-datasets/tree/master > > # project_name token server_url pid server read_only operational notes > # archer 9A81268476645C4E5F03428B8AC3AA7B https://bbmc.ouhsc.edu/redcap/api/ 153 oklahoma-bbmc TRUE TRUE simple structure; read-only > # archer D70F9ACD1EDD6F151C6EA78683944E98 https://bbmc.ouhsc.edu/redcap/api/ 213 oklahoma-bbmc FALSE TRUE simple structure; read & write > # archer 0434F0E9CF53ED0587847AB6E51DE762 https://bbmc.ouhsc.edu/redcap/api/ 212 oklahoma-bbmc TRUE TRUE longitudinal structure; read-only > # archer D72C6485B52FE9F75D27B696977FBA43 https://bbmc.ouhsc.edu/redcap/api/ 268 oklahoma-bbmc TRUE TRUE Russian characters; read-only > > archer01_csv <- + tryCatch( + export_core(uri = 'https://bbmc.ouhsc.edu/redcap/api/', token = '9A81268476645C4E5F03428B8AC3AA7B'), + error = function(e) {e} + ) Getting Project Info Getting project metadata Getting user data Getting project record > > Sys.setenv("REDCap_API_URI" = 'https://bbmc.ouhsc.edu/redcap/api/') > Sys.setenv("REDCap_API_TOKEN" = '9A81268476645C4E5F03428B8AC3AA7B') > archer01_json <- tryCatch(export_core(format = "json"), error = function(e) {e}) Getting Project Info Getting project metadata Getting user data Getting project record > > if (inherits(archer01_csv, "error") | inherits(archer01_json, "error")) { + if (inherits(archer01_csv, "curl_error") | inherits(archer01_json, "curl_error")) { + # skip the rest of the testing + print(sprintf("Skip test-export.R after curl error: %s", archer01_csv$message)) + } else { + stop("in test-export.R an non curl related error occured when initially calling export_core") + } + } else { + + stopifnot( + inherits(archer01_csv, "rcer_rccore"), + inherits(archer01_json, "rcer_rccore"), + inherits(archer01_csv$project_raw, "rcer_raw_project"), + inherits(archer01_json$project_raw, "rcer_raw_project"), + inherits(archer01_csv$metadata_raw, "rcer_raw_metadata"), + inherits(archer01_json$metadata_raw, "rcer_raw_metadata"), + inherits(archer01_csv$project_raw, "rcer_raw_project"), + inherits(archer01_json$project_raw, "rcer_raw_project"), + inherits(archer01_csv$record_raw, "rcer_raw_record"), + inherits(archer01_json$record_raw, "rcer_raw_record"), + grepl("text/csv", attr(archer01_csv$record_raw, "Content-Type")), + grepl("application/json", attr(archer01_json$record_raw, "Content-Type")) + ) + + a1 <- format_record(archer01_csv) + a2 <- format_record(archer01_json) + + # apparently the end of line characters are exported differently + a1$address <- gsub('\n', ' ', gsub('\r', '', a1$address)) + a2$address <- gsub('\n', ' ', gsub('\r', '', a2$address)) + a1$comments <- gsub('\n', ' ', gsub('\r', '', a1$comments)) + a2$comments <- gsub('\n', ' ', gsub('\r', '', a2$comments)) + + stopifnot(isTRUE(all.equal(a1, a2))) + + } Error in `$<-.data.frame`(`*tmp*`, address, value = character(0)) : replacement has 0 rows, data has 1 Calls: $<- -> $<-.data.frame Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [12s] OK * checking PDF version of manual ... [20s] OK * checking HTML version of manual ... [2s] OK * DONE Status: 1 ERROR