Skip to content

Commit 583f971

Browse files
MateusMaiaDSsunxd3
andauthored
R interface for JuliaBUGS.jl from the rjuliabugs package (#389)
# Final Report: GSoC '25 **Contributor Name**: Mateus Maia **Organization**: Turing.jl **Mentors**: Xianda Sun, Robert Goudie **Project**: `rjuliabugs` – R Interface for JuliaBUGS.jl ## Projects This PR has been created as part of the Google Summer of Code in the "rjuliabugs – R Interface for JuliaBUGS.jl" project. I have developed the `rjuliabugs` R package, which provides a bridge between R and JuliaBUGS, the BUGS-style Bayesian modeling interface developed in Julia. With this package, R users can run BUGS models through JuliaBUGS, leveraging advanced inference engines such as Hamiltonian Monte Carlo (HMC) while staying within the R environment. The package integrates seamlessly with R’s post-processing ecosystem, including tools like `bayesplot`, `posterior`, and `coda`, allowing for diagnostics and visualization of Bayesian models directly from R. The final result can be find in this repository: https://github.com/MateusMaiaDS/rjuliabugs and with a clear documentation through: https://mateusmaiads.github.io/rjuliabugs/ ## Features Able to perform the following: - Run BUGS models using JuliaBUGS from R - Interface with R visualization and post-processing tools (`bayesplot`, `posterior`, `coda`) - Seamless translation of BUGS code into Julia for efficient execution ## Constraints and Future Improvement Currently, `rjuliabugs` requires an initial setup (`setup_juliaBUGS()`) for Julia dependencies and is optimized for running one model at a time. Future improvements could include: - Improved progress bars for the sampler for running `rjuliabugs` inside the R console inside the R studio. - Keep adding more examples of models that can be used using JuliaBUGS within the R library. - Although `JuliaCall` can be efficient, a better integration between and Julia may upcome in the future which may speed-up the initialization when doing (`setup_juliaBUGS()`). ## Acknowledgements Thank you Turing.jl and Google Summer of Code for this amazing opportunity. I learned and applied my coding skills during this event. Special thanks to my mentors Xianda Sun and Robert Goudie for their guidance and support throughout the project. --------- Co-authored-by: Xianda Sun <[email protected]> Co-authored-by: Xianda Sun <[email protected]>
1 parent 20f2d58 commit 583f971

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

JuliaBUGS/docs/src/R_interface.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# R Interface
22

3-
Interoperation between Julia and R is very solid and simple to use.
3+
[**RJuliaBUGS**](https://mateusmaiads.github.io/rjuliabugs/) lets you run BUGS models from R using Julia's fast sampling algorithms.
44

5-
Here are some very useful packages:
5+
Created by [Mateus Maia](https://github.com/MateusMaiaDS) as part of Google Summer of Code 2025.
66

7-
- [`RCall.jl`](https://github.com/JuliaInterop/RCall.jl): interaction with R runtime.
8-
- [`RData.jl`](https://github.com/JuliaData/RData.jl): reading and writing R data files.
9-
- [`DataFrames.jl`](https://github.com/JuliaData/DataFrames.jl): `pandas` and `dplyr` for Julia.
10-
- [`CSV.jl`](https://github.com/JuliaData/CSV.jl): CSV file reading and writing.
11-
- [`JSON.jl`](https://github.com/JuliaIO/JSON.jl), [`JSON3.jl`](https://github.com/quinnj/JSON3.jl), [`Serde.jl`](https://github.com/bhftbootcamp/Serde.jl): JSON file reading and writing.
7+
## What is RJuliaBUGS?
8+
9+
RJuliaBUGS connects R to JuliaBUGS. You write models in BUGS syntax and run them from R, but they execute using Julia's modern samplers like Hamiltonian Monte Carlo (HMC).
10+
11+
**Key benefits:**
12+
- Keep your existing BUGS models
13+
- Run models faster with Julia's algorithms
14+
- Stay in R for all analysis
15+
- Works with `bayesplot`, `posterior`, `coda`, and other R packages
16+
17+
## Related Julia Packages
18+
19+
For R users working with Julia:
20+
21+
- [`RCall.jl`](https://github.com/JuliaInterop/RCall.jl) - Run R from Julia
22+
- [`RData.jl`](https://github.com/JuliaData/RData.jl) - Read/write R data files
23+
- [`DataFrames.jl`](https://github.com/JuliaData/DataFrames.jl) - Data manipulation (like `dplyr`)
24+
- [`CSV.jl`](https://github.com/JuliaData/CSV.jl) - Work with CSV files
25+
- [`JSON.jl`](https://github.com/JuliaIO/JSON.jl), [`JSON3.jl`](https://github.com/quinnj/JSON3.jl) - Work with JSON data

0 commit comments

Comments
 (0)