R Under development (unstable) (2026-04-23 r89955) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "randomForestRHF" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('randomForestRHF') randomForestRHF 1.0.0 Type randomForestRHFnews() to see new features, changes, and bug fixes. > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("auct.rhf") > ### * auct.rhf > > flush(stderr()); flush(stdout()) > > ### Name: auct.rhf > ### Title: Time-varying AUC(t) and iAUC for Random Hazard Forests (TDC) > ### Aliases: auct.rhf auct plot.auct.rhf print.auct.rhf > ### Keywords: survival ROC AUC > > ### ** Examples > > > > > cleanEx() > nameEx("importance.rhf") > ### * importance.rhf > > flush(stderr()); flush(stdout()) > > ### Name: importance.rhf > ### Title: Time-localized VarPro importance for random hazard forests > ### Aliases: importance.rhf varpro.cache.rhf varpro.cache > ### print.importance.rhf as.data.frame.importance.rhf plot.importance.rhf > ### dotmatrix.importance.rhf dotmatrix.importance > ### Keywords: rhf importance > > ### ** Examples > > > > > cleanEx() > nameEx("plot.rhf") > ### * plot.rhf > > flush(stderr()); flush(stdout()) > > ### Name: plot.rhf > ### Title: Plot smoothed hazard and cumulative hazard plots from RHF > ### analysis > ### Aliases: plot.rhf > ### Keywords: plot rhf > > ### ** Examples > > > > > > cleanEx() > nameEx("predict.rhf") > ### * predict.rhf > > flush(stderr()); flush(stdout()) > > ### Name: predict.rhf > ### Title: Prediction on Test Data for Random Hazard Forests > ### Aliases: predict.rhf > ### Keywords: predict rhf > > ### ** Examples > > > ## ------------------------------------------------------------ > ## canonical train/test example (synthetic data) > ## ------------------------------------------------------------ > > simID <- 1 > trn <- hazard.simulation(simID)$dta > tst <- hazard.simulation(simID)$dta > f <- "Surv(id, start, stop, event) ~ ." > > ## training > o <- rhf(f, trn, ntree = 3) > print(o) Number of records: 2,565 Sample size (unique IDs): 500 Average records per ID: 5.13 Number of deaths/events: 411 Number of trees: 3 Average tree size (leaves): 30 Average node size: 54 No. features tried at each split: 4 Total no. time-varying features: 1 Total no. features: 11 Family: surv-tdc Splitrule: sg.tdc No. of random splits: 10 OOB risk: -0.805 TDC analysis: YES > > ## testing > p <- predict(o, tst) entry.c:315:82: runtime error: pointer index expression with base 0x000000000001 overflowed to 0xfffffffffffffffd #0 0x7b711c01bba8 in entryPred /data/gannet/ripley/R/packages/tests-gcc-SAN/randomForestRHF/src/entry.c:315 #1 0x00000074a827 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:1039 #2 0x000000755f7a in do_dotcall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:1437 #3 0x0000008d7d62 in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8128 #4 0x0000008c4fa3 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7511 #5 0x000000863e62 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #6 0x00000087c64a in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2387 #7 0x00000088063a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2300 #8 0x000000a9f503 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2322 #9 0x000000a9f503 in applyMethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:120 #10 0x000000aa3300 in dispatchMethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:473 #11 0x000000aa5285 in Rf_usemethod.isra.0 /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:513 #12 0x000000aa5ea6 in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:579 #13 0x0000008e4f71 in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8148 #14 0x0000008c4fa3 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7511 #15 0x000000863e62 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #16 0x00000087c64a in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2387 #17 0x00000088063a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2300 #18 0x000000864513 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2322 #19 0x000000864513 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1278 #20 0x000000896a7e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3579 #21 0x000000864936 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1230 #22 0x000000a0b548 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #23 0x000000a0b548 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #24 0x000000a1a83a in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #25 0x000000a1a8d2 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #26 0x0000004130af in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #27 0x7f7138a12574 in __libc_start_call_main (/lib64/libc.so.6+0x3574) (BuildId: 92b5376d35bb29c098175948cf3e7cbcae3aeae1) #28 0x7f7138a12627 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3627) (BuildId: 92b5376d35bb29c098175948cf3e7cbcae3aeae1) #29 0x000000413a94 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413a94) (BuildId: c38d6e6465fdfa13fdb70f06336007caffc840ad) entry.c:353:84: runtime error: pointer index expression with base 0x000000000001 overflowed to 0xfffffffffffffffd #0 0x7b711c01bbc4 in entryPred /data/gannet/ripley/R/packages/tests-gcc-SAN/randomForestRHF/src/entry.c:353 #1 0x00000074a827 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:1039 #2 0x000000755f7a in do_dotcall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:1437 #3 0x0000008d7d62 in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8128 #4 0x0000008c4fa3 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7511 #5 0x000000863e62 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #6 0x00000087c64a in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2387 #7 0x00000088063a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2300 #8 0x000000a9f503 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2322 #9 0x000000a9f503 in applyMethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:120 #10 0x000000aa3300 in dispatchMethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:473 #11 0x000000aa5285 in Rf_usemethod.isra.0 /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:513 #12 0x000000aa5ea6 in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:579 #13 0x0000008e4f71 in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8148 #14 0x0000008c4fa3 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7511 #15 0x000000863e62 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #16 0x00000087c64a in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2387 #17 0x00000088063a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2300 #18 0x000000864513 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2322 #19 0x000000864513 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1278 #20 0x000000896a7e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3579 #21 0x000000864936 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1230 #22 0x000000a0b548 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #23 0x000000a0b548 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #24 0x000000a1a83a in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #25 0x000000a1a8d2 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #26 0x0000004130af in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #27 0x7f7138a12574 in __libc_start_call_main (/lib64/libc.so.6+0x3574) (BuildId: 92b5376d35bb29c098175948cf3e7cbcae3aeae1) #28 0x7f7138a12627 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3627) (BuildId: 92b5376d35bb29c098175948cf3e7cbcae3aeae1) #29 0x000000413a94 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413a94) (BuildId: c38d6e6465fdfa13fdb70f06336007caffc840ad) > print(p) Number of records: 2,640 Sample size (unique IDs): 500 Number of deaths/events: 419 Number of trees: 3 Average tree size (leaves): 30 Average node size: 54 No. features tried at each split: 4 Total no. time-varying features: 1 Total no. features: 11 Family: surv-tdc No. of random splits: 10 Test risk: -0.817 TDC analysis: YES > > > > > cleanEx() > nameEx("rhf") > ### * rhf > > flush(stderr()); flush(stdout()) > > ### Name: rhf > ### Title: Random Hazard Forests > ### Aliases: rhf > ### Keywords: rhf > > ### ** Examples > > > > ## ------------------------------------------------------------ > ## time-static pbc: parameters set for fast CRAN run > ## ------------------------------------------------------------ > > ## load the data > data(pbc, package = "randomForestSRC") > ## convert the data to counting process > d <- convert.counting(Surv(days, status) ~ ., na.omit(pbc)) > ## set the formula > f <- "Surv(id, start, stop, event) ~ ." > > ## rhf call > print((o <- rhf(f, d, ntree = 3))) Number of records: 276 Sample size (unique IDs): 276 Average records per ID: 1 Number of deaths/events: 111 Number of trees: 3 Average tree size (leaves): 11.667 Average node size: 15.216 No. features tried at each split: 5 Total no. time-varying features: 0 Total no. features: 17 Family: surv-tdc Splitrule: sg.tdc No. of random splits: 10 OOB risk: -0.052 TDC analysis: NO (records per ID = 1) > > ## smooth hazard estimator for specific cases > plot(o, idx=c(1,5,10)) > plot(o, idx=c(1,5,10), hazard.only=TRUE) > plot(o, idx=c(1,5,10), hazard.only=TRUE, lwd=0) > plot(o, idx=1:10, lwd=0, hazard.only=TRUE, legend.show=FALSE) > > > > > cleanEx() > nameEx("smoothed.hazard.rhf") > ### * smoothed.hazard.rhf > > flush(stderr()); flush(stdout()) > > ### Name: smoothed.hazard.rhf > ### Title: Smoothed hazard and cumulative hazard estimates from a random > ### hazard forest > ### Aliases: smoothed.hazard.rhf smoothed.hazard > ### Keywords: survival models > > ### ** Examples > > > > > cleanEx() > nameEx("tune.treesize.rhf") > ### * tune.treesize.rhf > > flush(stderr()); flush(stdout()) > > ### Name: tune.treesize.rhf > ### Title: Tune tree size for Random Hazard Forests > ### Aliases: tune.treesize.rhf tune.rhf tune.iAUC.rhf tune.iAUC > ### plot.tune.treesize.rhf > ### Keywords: survival tuning > > ### ** Examples > > > > ### *