Skip to content
Review

r2py: AI-Assisted Conversion of R Statistical Packages to Python

Jul 2026 · 0 citations · 28 references
Mathematics Computer Science

Abstract

Thousands of R packages hold statistical methods with no native Python equivalent. Runtime bridges require an R installation; hand-written ports do not scale. Translation fails silently where the languages diverge, as in transform normalization, integer width, and argument evaluation. We present r2py, a framework that converts an R package into a native Python library using orchestrated language-model agents under human supervision, with correctness established by numerical comparison against the original at declared tolerances. The compiled code is retained unmodified, so any divergence lies in the translation. Seven phases decompose the work for independent invocations: structural analysis fixes conversion order, every base-R construct's rendering is settled in reviewable guides before code generation, and four verification methods each expose defects their predecessors miss. Packages reaching compiled code through .Call() add a five-phase prologue reconstructing the R C API they use. Conversions of KernSmooth and rpart reproduce R across 518 and 846 tests.

View source

Similar papers

Jul 2026

RepBench: Compiling Benchmarks into Capability Representations for Large Language Models

Under cross-benchmark transfer evaluation across twelve models completed by all four readouts, difference-in-means attains the highest model-level mean on ten models, while logistic regression wins the most capability-model cells.

Yan-Shi Li, Xue Bai, Shu-Man Liu et al. · 0 citations
Preprint Sep 2026

Where the LLM Ends and Reliable Decisions Begin

The ANVIL compiler architecture is proposed, where ANVIL performs exceptionally well on leading benchmarks by using language models purely where they are effective, rather than as a catch-all tool.

Priyadarshan Patil, A. Basu, Vikas Reddy et al. · 0 citations
Preprint Aug 2026

Evolving Executable Pipeline Programs for AutoML with Language Models

This work presents LACE, an AutoML framework that instead searches over complete executable pipeline programs: an evolutionary loop maintains a population of scikit-learn-compatible Python classes, and a large language model acts as the variation operator.

Sofoklis Kitharidis, C. Veenman, J. V. van Rijn et al. · 0 citations
Jul 2026

No Snake Oil: Verifying Python Package Builds

Daleq4py is presented and evaluated, a tool to establish the equivalence of Python wheels through the kernel of a normalisation function that is based on provenance-preserving datalog rules, and results show that daleq4py substantially expands the set of rebuilds that can be accepted as equivalent.

Jens Dietrich, Spencer Sun, Tim White et al. · 0 citations
Open access Sep 2026

scPyviewer: a Python-native interactive viewer from AnnData single-cell data

ScPyviewer is a web-based viewer that ingests AnnData objects directly and reproduces the core interaction patterns of the incumbent R Shiny tools without leaving the Python stack and uniquely offers native AnnData ingestion with no Seurat conversion, and cross-dataset comparison over shared genes and matched cell-type...

Hao Xuan, Yu Huang, Jiang Bian et al. · 0 citations
#artificial intelligence Preprint Sep 2026

An Empirical Evaluation of Cost-Efficient Large Language Models on Algorithmic Programming Tasks

This study empirically evaluates whether cost-efficient Large Language Models (LLMs) can be trusted to generate enterprise code to a written specification. Three models (Gemini Flash 3, GPT-5.4 mini and Claude Haiku 4.5) were asked to solve 992 algorithmic problems as Java Spring Boot service methods conforming to a ma...

Chandimal Adikari, Nandika Herath · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.