# In search for a Julia analog of an R's package

**URL:** <https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413>\
**Category:** Statistics\
**Tags:** question, package, r\
**Created:** [April 2, 2024, 11:27am UTC](https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413 "2024-04-02T11:27:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvbond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vvbond/32/10105_2.png) [@vvbond](https://discourse.julialang.org/u/vvbond)\
**Post date:** [April 2, 2024, 11:27am UTC](https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413/1 "2024-04-02T11:27:36Z")

</div>

My question is motivated by the need for a quick Deming regression computation.  
In R, it is included in the mcr, [Method Comparison Regression](https://cran.r-project.org/web/packages/mcr/index.html), package. Alas, my search for a Julia’s alternative wasn’t successful, despite Julia’s excellent statistics ecosystem.

I guess there is no real demand for it in the community. By what do you people do when you find yourself in need for something that exists in an R? Is using RCall, instead of porting a package, the preferred approach?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [April 2, 2024, 11:48am UTC](https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413/2 "2024-04-02T11:48:04Z")

</div>

> [@vvbond](#):
>
> Is using RCall, instead of porting a package, the preferred approach?

Yes, I would say that’s right, at least for one-off usages. I’d say the hierarchy is:

1. Just use RCall to call R
2. Write a package which depends on RCall to wrap the R library, exposing a Julia API
3. Write a pure-Julia port of the R functionality

Sometimes 2 and 3 can go hand-in-hand, i.e. you could start with 2 and gradually replace some functionality with pure-Julia ports.

---

<div class="post-metadata">

**Author:** ![ayushpatnaikgit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ayushpatnaikgit/32/25229_2.png) [@ayushpatnaikgit](https://discourse.julialang.org/u/ayushpatnaikgit)\
**Post date:** [April 2, 2024, 12:00pm UTC](https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413/3 "2024-04-02T12:00:00Z")

</div>

I did this a few years ago:

> <https://github.com/xKDR/NighttimeLights.jl/blob/514af35e102e52f728e1dd44d3c7b67e50983a60/src/data_cleaning/bias_correction.jl>

I used RCall for functions that didn’t exist in Julia, then gradually replaced them with native code.

---

<div class="post-metadata">

**Author:** ![vvbond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vvbond/32/10105_2.png) [@vvbond](https://discourse.julialang.org/u/vvbond)\
**Post date:** [April 2, 2024, 1:09pm UTC](https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413/4 "2024-04-02T13:09:27Z")

</div>

Thanks for the confirmation!

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [April 2, 2024, 1:31pm UTC](https://discourse.julialang.org/t/in-search-for-a-julia-analog-of-an-rs-package/112413/5 "2024-04-02T13:31:44Z")

</div>

More general than Deming regression: [Package for implementing regression with spatial correlation - #2 by Mattriks](https://discourse.julialang.org/t/package-for-implementing-regression-with-spatial-correlation/111893/2)
