Leveraging Python and JAX in R workflows

Andrés Cruz (UT Austin)

NU Statistical Computing Workshop

Apr 22, 2026

Python won\(^*\)

  • * in ML/AI
  • Are we missing out?

R vs Python (yet again?)

  • R: statistics/data analysis focused
    • Data wrangling
    • Plotting
    • Solid stats / econometrics / pol. methodology
  • Python: general-purpose
    • Inter-operability (e.g., API calls)
    • Cutting-edge AI/ML
  • Question: are LLMs better at R or Python?

R vs Python: LLM performance

  • 🐍 “LLMs Love Python” (Twist et al. 2026)

    • In language-agnostic queries, “Python accounts for 90-97% of generated solutions” (7)
  • ®️ AutoCodeBench performance (Chou et al. 2025, 6)

A compromise

  • Integrate tidbits of Python into our R workflows

What we’ll cover today

  1. Using the reticulate package

    • Example: sentence-level semantic similarity
  2. Leveraging JAX, a high-performance Python library

    • Automatic differentiation

    • Example: sensitivity bound for error propagation

References

Chou, Jason, Ao Liu, Yuchi Deng, Zhiying Zeng, Tao Zhang, Haotian Zhu, Jianwei Cai, et al. 2025. “AutoCodeBench: Large Language Models Are Automatic Code Benchmark Generators.” https://arxiv.org/abs/2508.09101.
Twist, Lukas, Jie M. Zhang, Mark Harman, Don Syme, Joost Noppen, Helen Yannakoudakis, and Detlef Nauck. 2026. “A Study of LLMs’ Preferences for Libraries and Programming Languages.” https://arxiv.org/abs/2503.17181.