* using log directory 'd:/RCompile/CRANincoming/R-devel/rjaf.Rcheck' * using R Under development (unstable) (2024-09-15 r87152 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.2.0 GNU Fortran (GCC) 13.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'rjaf/DESCRIPTION' ... OK * this is package 'rjaf' version '0.1.0' * package encoding: UTF-8 * checking CRAN incoming feasibility ... NOTE Maintainer: 'Xinyi Zhang ' New submission Possibly misspelled words in DESCRIPTION: Ladhania (28:139) Spiess (28:149) Ungar (28:157) * 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 'rjaf' can be installed ... OK * used C++ compiler: 'g++.exe (GCC) 13.2.0' * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... 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 ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... 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 ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... 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 ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking examples ... ERROR Running examples in 'rjaf-Ex.R' failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: rjaf > ### Title: Regularized Joint Assignment Forest with Treatment Arm > ### Clustering > ### Aliases: rjaf > > ### ** Examples > > library(dplyr) Attaching package: 'dplyr' The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union > library(MASS) Attaching package: 'MASS' The following object is masked from 'package:dplyr': select > sim.data <- function(n, K, gamma, sigma, prob=rep(1,K+1)/(K+1)) { + # K: number of treatment arms + options(stringsAsFactors=FALSE) + data <- left_join(data.frame(id=1:n, + trt=sample(0:K, n, replace=TRUE, prob), + mvrnorm(n, rep(0,3), diag(3))), + data.frame(trt=0:K, prob), by="trt") + data <- mutate(data, tmp1=10+20*(X1>0)-20*(X2>0)-40*(X1>0&X2>0), + tmp2=gamma*(2*(X3>0)-1)/(K-1), + tmp3=-10*X1^2, + Y=tmp1+tmp2*(trt>0)*(2*trt-K-1)+tmp3*(trt==0)+rnorm(n,0,sigma)) + # Y: observed outcomes + Y.cf <- data.frame(sapply(0:K, function(t) # counterfactual outcomes + mutate(data, Y=tmp1+tmp2*(t>0)*(2*t-K-1)+tmp3*(t==0))$Y)) + names(Y.cf) <- paste0("Y",0:K) + return(mutate(bind_cols(dplyr::select(data, -c(tmp1,tmp2,tmp3)), Y.cf), + across(c(id, trt), as.character))) + } > > n <- 200; K <- 3; gamma <- 10; sigma <- 10 > Example_data <- sim.data(n, K, gamma, sigma) > Example_trainest <- Example_data %>% slice_sample(n = floor(0.5 * nrow(Example_data))) > Example_valid <- Example_data %>% filter(!id %in% Example_trainest$id) > id <- "id"; y <- "Y"; trt <- "trt" > vars <- paste0("X", 1:3) > forest.reg <- rjaf(Example_trainest, Example_valid, y, id, trt, vars, ntrt = 4, + clus.tree.growing = FALSE, setseed = TRUE) Error: Mat::operator(): index out of bounds Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... ERROR Running 'testthat.R' Running the tests in 'tests/testthat.R' failed. Complete output: > library(testthat) > library(rjaf) > > test_check("rjaf") [ FAIL 1 | WARN 0 | SKIP 0 | PASS 1 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-rjaf.R:9:3'): rjaf function computes correctly ───────────────── Error: Mat::operator(): index out of bounds Backtrace: ▆ 1. └─rjaf::rjaf(...) at test-rjaf.R:9:3 2. └─base::lapply(...) 3. └─rjaf (local) FUN(X[[i]], ...) 4. ├─stats::kmeans(...) 5. │ └─base::as.matrix(x) 6. ├─base::t(...) 7. ├─base::do.call(...) 8. └─base::lapply(...) 9. └─rjaf (local) FUN(X[[i]], ...) 10. └─rjaf:::rjaf_cpp(...) [ FAIL 1 | WARN 0 | SKIP 0 | PASS 1 ] Error: Test failures Execution halted * checking PDF version of manual ... [14s] OK * checking HTML version of manual ... OK * DONE Status: 2 ERRORs, 1 NOTE