How to reconfigure Jupyter Notebook to locate specific version of R?
1
1
Entering edit mode
@davidwheeler7-19959
Last seen 5.8 years ago

How does one make Jupyter notebook use a specific version of R?

  • I have had some issues with running DESeq2 via Jupyter Notebook from Anaconda (https://support.bioconductor.org/p/118241/)
  • We recently downloaded a separate version of R from CRAN (not via Anaconda). This version has none of the problem we experienced with the version from Anaconda. However, we can not get Jupyter Notebook to use this newer version of R. It, by default, uses the older/Anaconda problem, which results in my inability to use DESeq2.

Thank you in advance for your time!

deseq2 software error • 4.5k views
ADD COMMENT
0
Entering edit mode

Can I suggest that you use

jupyter --data-dir

to find the folder where ir/kernel.json lives

In that json file there is an object that looks something like this

{"argv": ["R", "--slave", "-e", "IRkernel::main()", "--args", "{connection_file}"],
 "display_name":"R",
 "language":"R"
}

i speculate that if you change the first "R" to the quoted string giving the absolute path of the R you want to run, and restart your jupyter, you will have the R you want. For example

 {"argv": ["/usr/local/bin/R", "--slave", "-e", "IRkernel::main()", "--args", "{connection_file}"],
     "display_name":"R",
     "language":"R"
    }
ADD REPLY
0
Entering edit mode

I have confirmed that this strategy works. You have to find the right kernel.json and ensure that the version of R you want to use has a functioning IRkernel package installed.

ADD REPLY
0
Entering edit mode

Thanks Vincent! I found the file! To find the absolute path for R is it correct that I should not use getwd() but instead find the app then use command+i? For me this means that it is "Macintosh HD/Applications/R"

Sorry for the rookie questions

ADD REPLY
1
Entering edit mode
@davidwheeler7-19959
Last seen 5.8 years ago

I think you figured it our Vincent! The version command via JN now works and provided the current R which we installed. I will try some packages tomorrow morning and report back.

Thanks!

ADD COMMENT

Login before adding your answer.

Traffic: 766 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6