R Under development (unstable) (2026-07-21 r90286) -- "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 <- "PTT" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('PTT') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("apt") > ### * apt > > flush(stderr()); flush(stdout()) > > ### Name: apt > ### Title: Fit an Adaptive Pólya Tree > ### Aliases: apt > > ### ** Examples > > set.seed(12345) > x <- c(rbeta(40, 3, 8), rbeta(40, 9, 3)) > grid <- seq(0.05, 0.95, length.out = 25) > fit <- apt(x, Xpred = grid, max.resol = 4, n.grid = 3, n.s = 3) > head(fit$predictive_densities) [1] 0.9889265 0.9961841 1.0059555 1.0059555 1.0089468 1.0089468 > > > > cleanEx() > nameEx("cond.apt") > ### * cond.apt > > flush(stderr()); flush(stdout()) > > ### Name: cond.apt > ### Title: Fit a Conditional Adaptive Pólya Tree > ### Aliases: cond.apt > > ### ** Examples > > set.seed(12345) > x <- runif(80) > y <- rbeta(80, 2 + 6 * x, 8 - 5 * x) > fit <- cond.apt( + x, y, Xpred = c(0.25, 0.75), Ypred = c(0.3, 0.7), + max.resX = 3, max.resY = 4, n.grid = 3, n.s = 3 + ) cgbt.cpp:256:41: runtime error: shift exponent -65533 is negative #0 0x7ba1ebe0d9fc in CondGBT::find_hmap_part() /data/localhost/ripley/R/packages/tests-gcc-SAN/PTT/src/cgbt.cpp:256 #1 0x7ba1ebe9c481 in fitCondPTTcpp(arma::Mat, arma::Mat, arma::Mat, arma::Mat, arma::Mat, arma::Mat, int, int, double, int, double, int, int, double, double, int, int, double, int) /data/localhost/ripley/R/packages/tests-gcc-SAN/PTT/src/main.cpp:247 #2 0x7ba1ebe385c7 in _PTT_fitCondPTTcpp /data/localhost/ripley/R/packages/tests-gcc-SAN/PTT/src/RcppExports.cpp:62 #3 0x00000075bc45 in R_doDotCall /data/localhost/ripley/R/svn/R-devel/src/main/dotcode.c:853 #4 0x000000761eea in do_dotcall /data/localhost/ripley/R/svn/R-devel/src/main/dotcode.c:1437 #5 0x0000008eb97b in bcEval_loop /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:8150 #6 0x0000008d687b in bcEval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:7533 #7 0x000000877eba in Rf_eval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:1167 #8 0x00000088e6ca in R_execClosure /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:2398 #9 0x00000089235d in applyClosure_core /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:2314 #10 0x000000878568 in Rf_applyClosure /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:2333 #11 0x000000878568 in Rf_eval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:1278 #12 0x0000008a689e in do_set /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:3585 #13 0x000000878996 in Rf_eval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:1230 #14 0x000000a1ee48 in Rf_ReplIteration /data/localhost/ripley/R/svn/R-devel/src/main/main.c:264 #15 0x000000a1ee48 in R_ReplConsole /data/localhost/ripley/R/svn/R-devel/src/main/main.c:317 #16 0x000000a3cada in run_Rmainloop /data/localhost/ripley/R/svn/R-devel/src/main/main.c:1237 #17 0x000000a3cb72 in Rf_mainloop /data/localhost/ripley/R/svn/R-devel/src/main/main.c:1244 #18 0x000000411f5f in main /data/localhost/ripley/R/svn/R-devel/src/main/Rmain.c:29 #19 0x7fa1f7e0a680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 17f2e1fd905f485786f6fd6e3bede4ad737137e7) #20 0x7fa1f7e0a797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 17f2e1fd905f485786f6fd6e3bede4ad737137e7) #21 0x000000412924 in _start (/data/localhost/ripley/R/gcc-SAN3/bin/exec/R+0x412924) (BuildId: 7bd069e7b1c3f2758f94ae347cb95ae3bb7314b6) > fit$predictive_densities [1] 1.353063 1.155606 > > > > cleanEx() > nameEx("cond.opt") > ### * cond.opt > > flush(stderr()); flush(stdout()) > > ### Name: cond.opt > ### Title: Fit a Conditional Optional Pólya Tree > ### Aliases: cond.opt > > ### ** Examples > > set.seed(12345) > x <- runif(60) > y <- ifelse(x < 0.5, rbeta(60, 3, 8), rbeta(60, 8, 3)) > fit <- cond.opt( + x, y, Xpred = c(0.25, 0.75), Ypred = c(0.3, 0.7), + max.resX = 3, max.resY = 4 + ) > fit$predictive_densities [1] 1.826361 2.355811 > > > > cleanEx() > nameEx("opt") > ### * opt > > flush(stderr()); flush(stdout()) > > ### Name: opt > ### Title: Fit an Optional Pólya Tree > ### Aliases: opt > > ### ** Examples > > set.seed(12345) > x <- rbeta(60, 4, 7) > fit <- opt(x, Xpred = c(0.25, 0.5, 0.75), max.resol = 4) > fit$predictive_densities [1] 2.1098088 1.3627524 0.1406881 > > > > cleanEx() > nameEx("plot_partition") > ### * plot_partition > > flush(stderr()); flush(stdout()) > > ### Name: plot_partition > ### Title: Plot a Two-Dimensional Partition > ### Aliases: plot_partition plot.part > > ### ** Examples > > cells <- data.frame( + xmin = c(0, 0.5), xmax = c(0.5, 1), + ymin = c(0, 0), ymax = c(1, 1), den = c(0.6, 1.4) + ) > plot_partition(cells, plot.scale = FALSE) > > > > cleanEx() > nameEx("plot_roc_curve") > ### * plot_roc_curve > > flush(stderr()); flush(stdout()) > > ### Name: plot_roc_curve > ### Title: Plot an Empirical ROC Curve > ### Aliases: plot_roc_curve plot.roc > > ### ** Examples > > set.seed(12345) > null <- rnorm(100) > alternative <- rnorm(100, mean = -1) > roc <- plot_roc_curve(alternative, null) > head(roc) fpr threshold tpr 1 0.00 -2.380358 0.07 2 0.01 -2.347278 0.07 3 0.02 -1.842669 0.21 4 0.03 -1.818389 0.21 5 0.04 -1.668286 0.22 6 0.05 -1.600927 0.23 > > > > ### *