# Can we start R and Jupyter from the same repo?

**URL:** <https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120>\
**Category:** Binder\
**Created:** [September 24, 2020, 3:19pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120 "2020-09-24T15:19:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![silask](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/silask/32/4027_2.png) [@silask](https://discourse.jupyter.org/u/silask)\
**Post date:** [September 24, 2020, 3:19pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/1 "2020-09-24T15:19:18Z")

</div>

Can we start R and Jupyter from the same repo ideally using a conda env for both?

How should I make the distinction?

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [September 24, 2020, 3:49pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/2 "2020-09-24T15:49:05Z")

</div>

Have you looked at [the R + Python Binder Example](https://github.com/binder-examples/r_with_python)?

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 24, 2020, 5:51pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/3 "2020-09-24T17:51:24Z")

</div>

You can easily install both Python and R in the same conda environment. If it’s not working for you please can you post a link to your repo?

---

<div class="post-metadata">

**Author:** ![silask](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/silask/32/4027_2.png) [@silask](https://discourse.jupyter.org/u/silask)\
**Post date:** [September 25, 2020, 9:34am UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/4 "2020-09-25T09:34:41Z")

</div>

Thank you for your quick answers. This community is very active! 🙂

So I combined R and python in the same conda env. I followed the instructions to create specific rstudio and jupyter lab links in the R + Python Binder Example.

Here is the repo. I work on the ‘tr\_rmd’ branch

> **[metagenome-atlas/Tutorial](https://github.com/metagenome-atlas/Tutorial/tree/tr_rmd)**
>
> A tutorial for Metagenome-Atlas given at ECCB. Contribute to metagenome-atlas/Tutorial development by creating an account on GitHub.

For now, the jupyter builds sometimes but the [Rstudio](http://mybinder.org/v2/gh/metagenome-atlas/Tutorial/tr_rmd?filepath=R?urlpath=rstudio) takes very long. Which doesn’t make so much sense to me, because it should be the same docker, isn’t it?.

I thought about speeding up the building with a separate environment repo. Should I then create two environment repos. One for R and one for python?

---

<div class="post-metadata">

**Author:** ![silask](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/silask/32/4027_2.png) [@silask](https://discourse.jupyter.org/u/silask)\
**Post date:** [September 25, 2020, 9:50am UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/5 "2020-09-25T09:50:02Z")

</div>

The binder loding hangs with

nothing provides requested r-base 3.6.1-3bionic\*\*

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 25, 2020, 9:24pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/6 "2020-09-25T21:24:56Z")

</div>

You’ve got `r-base=4` in your environment.yml

> <https://github.com/metagenome-atlas/Tutorial/blob/129927002054e49e46e1064d41caa793820c7ba2/binder/environment.yml#L16>

But you’ve also added runtime.txt

> <https://github.com/metagenome-atlas/Tutorial/blob/129927002054e49e46e1064d41caa793820c7ba2/binder/runtime.txt#L1>

  
Can you try deleting this file?

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [September 26, 2020, 3:39pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/7 "2020-09-26T15:39:04Z")

</div>

To follow-up on what @manics said, see [here](https://discourse.jupyter.org/t/cannot-get-r-project-working/2917/15) and my next reply below in that discussion for an idea of why adding `runtime.txt` hijacks the R installation to make it incompatible with what is in your `environment.yml`. The first example I gave you didn’t refer to the import caveats discussed [here](https://github.com/binder-examples/r-conda) about not mixing the approaches. [There](https://github.com/binder-examples/r-conda) specifically addresses `install.R`; however, I think `runtime.txt` triggers that same process and so it is also incompatible, I believe.

---

<div class="post-metadata">

**Author:** ![silask](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/silask/32/4027_2.png) [@silask](https://discourse.jupyter.org/u/silask)\
**Post date:** [September 28, 2020, 12:55pm UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/8 "2020-09-28T12:55:59Z")

</div>

Thank you @fomightez and @manics  
I removed the runtime.txt and the binder could be built! Great.

I need to figure out how to specify a different path. If you would have some advice on this it would be welcome.

I tried to use ?filepath=scripts?urlpath=rstudio

and ?urlpath=rstudio/tree/scripts to start Rstudio in the scripts directory but it didn’t worked.

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 30, 2020, 10:37am UTC](https://discourse.jupyter.org/t/can-we-start-r-and-jupyter-from-the-same-repo/6120/9 "2020-09-30T10:37:48Z")

</div>

I don’t think it’s possible to start rstudio under a custom directory. I might be wrong though.
