Installation

rbartpackages drives R packages through rpy2, so you need both a Python and an R installation.

Python package

pip install rbartpackages

(Or the equivalent for your package manager, e.g. uv add rbartpackages.) To install the latest development version:

pip install git+https://github.com/bartz-org/rbartpackages.git

Optional extras enable the corresponding input-conversion paths: pandas and polars let you pass data frames, jax lets you pass jax arrays.

pip install rbartpackages[pandas,polars,jax]

R packages

Install R, then install the wrapped packages you intend to use. BART, dbarts and bartMachine are on CRAN; BART3 and missBART live on GitHub:

install.packages(c("BART", "dbarts", "bartMachine"))
# BART3 and missBART:
install.packages("remotes")
remotes::install_github("rsparapa/bnptools/BART3")
remotes::install_github("yongchengoh/missBART")

bartMachine is a Java package and additionally requires a working Java toolchain and rJava (run R CMD javareconf after installing a JDK).

Importing a wrapper (e.g. from rbartpackages import BART3) requires the matching R package to be installed, because the class docstrings are pulled from the R documentation at import time.