R Under development (unstable) (2026-07-22 r90289) -- "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 0x7f7862faa378 in CondGBT::find_hmap_part() /data/gannet/ripley/R/packages/tests-clang-UBSAN/PTT/src/cgbt.cpp:256:41 #1 0x7f7862fc1a8d 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/gannet/ripley/R/packages/tests-clang-UBSAN/PTT/src/main.cpp:247:82 #2 0x7f7862f9e4d5 in _PTT_fitCondPTTcpp /data/gannet/ripley/R/packages/tests-clang-UBSAN/PTT/src/RcppExports.cpp:62:34 #3 0x557af8928a4b in R_doDotCall (/data/gannet/ripley/R/R-clang/bin/exec/R+0x90a4b) #4 0x557af892933d in do_dotcall (/data/gannet/ripley/R/R-clang/bin/exec/R+0x9133d) #5 0x557af8967d53 in bcEval_loop eval.c #6 0x557af896131b in bcEval eval.c #7 0x557af8960ad4 in Rf_eval (/data/gannet/ripley/R/R-clang/bin/exec/R+0xc8ad4) #8 0x557af8978c38 in R_execClosure eval.c #9 0x557af897812a in applyClosure_core eval.c #10 0x557af89619f6 in Rf_applyClosure (/data/gannet/ripley/R/R-clang/bin/exec/R+0xc99f6) #11 0x557af8960f27 in Rf_eval (/data/gannet/ripley/R/R-clang/bin/exec/R+0xc8f27) #12 0x557af897df97 in do_set (/data/gannet/ripley/R/R-clang/bin/exec/R+0xe5f97) #13 0x557af8960cff in Rf_eval (/data/gannet/ripley/R/R-clang/bin/exec/R+0xc8cff) #14 0x557af89ae1d7 in Rf_ReplIteration (/data/gannet/ripley/R/R-clang/bin/exec/R+0x1161d7) #15 0x557af89afcde in run_Rmainloop (/data/gannet/ripley/R/R-clang/bin/exec/R+0x117cde) #16 0x557af89afd4a in Rf_mainloop (/data/gannet/ripley/R/R-clang/bin/exec/R+0x117d4a) #17 0x557af8899db7 in main (/data/gannet/ripley/R/R-clang/bin/exec/R+0x1db7) #18 0x7f7870e12574 in __libc_start_call_main (/lib64/libc.so.6+0x3574) (BuildId: 92b5376d35bb29c098175948cf3e7cbcae3aeae1) #19 0x7f7870e12627 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3627) (BuildId: 92b5376d35bb29c098175948cf3e7cbcae3aeae1) #20 0x557af8899cd4 in _start (/data/gannet/ripley/R/R-clang/bin/exec/R+0x1cd4) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior cgbt.cpp:256:41 > 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 > > > > ### *