Installing R Language on Jupyter Notebook - r

I've checked all the resources and tutorials from the internet and it seems all are requiring to install Anaconda just to build the R kernel.
Is there a way to add R kernel to my jupyter notebook without installing Anaconda? If so, how?
Thanks!

I've solved my problem, by installing R into my machine. Upon installing, run the application and I follow this tutorial, by just copying the stated command.
Here's the link for the installation of native R.

Related

Problems installing RStudio in anaconda environment (base) on ubuntu

I am not able to get rstudio into my anaconda base environment. I have tried installing it from the GUI and from the command line. In the GUI it just says that it is installing and either A) crashes, or B) stays on the installing screen forever.
I am using the following code in the base env.
conda install rstudio
System: Ubuntu 19.10 on vitualboxVM with a mac os mojave host.
Also, It is trying to install pypq, is this the problem? This doesn't seem like a package I need for my R scripts, do popular R packages depend on it? If not, can I tell anaconda just to skip installing it?
The terminal log is very long so I attached the image instead of copying the code:
UPDATE: I can install in another env, but not base.
Yes, that's it. For some reason you cannot install R Studio in the base environment but you're obliged to create a specific R environment to install it.

How do you add Jupyter Notebook kernels for prior versions of Julia?

I am using a Windows machine and trying to have Jupyter Notebook kernels for multiple versions of Julia (0.7.0 and 1.1.1) because package AWS does not support the latest version, but does support 0.7.0.
I had Julia 1.1.1 installed on my computer first and got something similar to the following error when I tried to install package AWS: https://github.com/JuliaLang/Pkg.jl/issues/792
Then I installed Julia 0.7.0 and was able to install AWS in the Julia 0.7.0 terminal with Pkg.add("AWS") with no problems.
In the Julia 0.7.0 terminal, I installed IJulia again with Pkg.add("IJulia") and restarted my Jupyter notebook instance. Now I'd like to use AWS via Jupyter notebook but when I create a new one, only Julia 1.1.1 appears.
I ended up having success by showing which kernels I had using jupyter kernelspec list in terminal, which showed where my other Julia kernel was located.
>>> jupyter kernelspec list
Available Kernels:
julia-1.1 C:\Users\{%USERNAME%}\AppData\Roaming\jupyter\kernels\julia-1.1
python3 C:\ProgramData\Anaconda3\share\jupyter\kernels\python3
I navigated to the file path listed after julia-1.1
Created a julia-0.7 folder in that same directory
Copied over contents from the julia-1.1 folder
Edited the kernel.json file by replacing every instance of julia-1.1.1 with julia-0.7.0
What I ended up having success with seems like a very rudimentary way to solve this problem. I'd like a more elegant way to achieve the same result, similar to when adding multiple kernels for different versions of Python. (Using both Python 2.x and Python 3.x in IPython Notebook)
Please help, thank you!
You (probably) just need to Pkg.build("IJulia") on the second Julia version.
Since Julia 0.7 the package manager uses separate directories for each version of a package, meaning that, from the package managers perspective, the package is already installed, and no downloading or building is performed when you install the same version from a different Julia version. The package manager does not know, however, that IJulia needs to be rebuilt for this new Julia version. You can trigger the build manually by Pkg.build("IJulia").

Specify R for Jupyter Notebook with Anaconda Windows

I feel pretty comfortable working with R, and I want to get into Python through Anaconda.
Upon trying the Jupyter Notebook and finding it has compatibility with R, I really want to use it.
I'm having problem installing the R packages that don't come in R-essentials; and mainly because I noticed it uses a different R installation than the one I had before. Not only is this a different R installation, but it also uses a previous version of R. In my local installation I have updated to 3.2.3 but in the Anaconda environment for Jupyter I got 3.1.
I also found a post to change the .libPaths variable to include the packages that I had already installed. Still, I see this as a potential problem because of the different R versions.
I wanted to know if I can update the R version that's used in Anaconda, or if I can point to the one that's installed locally.
Thank you.
You can install IRkernel in the normal R installation and then register the kernel: simply follow the instructions at http://irkernel.github.io/installation/

specifying R library path for RKernel in Anaconda Jupyter notebook

First let me preface this with the disclaimer that I'm new to R, but a longtime Python power user. Given that I love the conda ecosystem and the Jupyter notebook, I'm trying to set them up as my R development environment as well.
So using the instructions at: https://www.continuum.io/blog/developer/jupyter-and-conda-r I've set up a Jupyter Notbook that using an RKernel that should be hitting the installation of R installed in my Anaconda folder (I would think anyway).
Getting it setup was easy peasy and everything is working great for standard R stuff but my analysis requires some R libraries that are not available in r-essentials channel. No problem, I think I know how to install an R library. I go to "C:\Anaconda\R\bin\x64\Rgui.exe" and install rgdal, dismo, and some other packages. To check my work I looked in C:\Anaconda\R\library and there they are.
But when I run a jupyter notebook from the Anaconda command prompt. And start a new R notebook I get a "Error in library(dismo): there is no package called 'dismo'" Wait a sec, I run a ".libPaths()" from the notebook and it looks like its pointing
You can add .libPaths('path_where_your_packages_are') in a code cell at the beginning of your notebook to tell jupyter where your packages are. For me that was .libPaths('~/R/win-library/3.2') (work-around from discnerd who filed this issue on github).
To find out the path to your packages, just install a random package in R and wait for the location to be printed to the console.
More details (likely specific to my system/installations): When running .libPaths() in R, I got 2 locations: one for which admin rights were required for writing, and one for which admin rights were not required for writing. While packages installed through R land in the location where admin rights are not required, jupyter looks at the location where admin rights are required.
You can find out the path to your library with installed.packages()

Off-line installation of IRkernel for Jupyter/IPython notebook

I am working on an off-line Ubuntu server and I would like to write an IPython notebook with only R code. I understand that for this to work I need to install the IRkernel. This shouldn't be a problem if the server was on-line, but unfortunately this is not the case. Any suggestions how to install the IRkernel off-line are greatly appreciated.
Oliver
(I have installed Anaconda3-2.2.0-x86-64 and R 3.0.2 on the Ubuntu server)
You can use Cube to download the required Ubuntu packages (I think just zmq3) on an online computer and then install it on your offline server.
You would then need to download the needed R packages (rzmq,repr,IRkernel,IRdisplay - in tar.gz form)
To load those into your server you can use the following commands to install the R packages from source.
R CMD INSTALL package_ x.y.z.tar.gz
If you don't have permission to write to the standard library directory and can't use sudo to override, you can install it somewhere else via
R CMD INSTALL -l <user_lib> package_x.y.z.tar.gz
where <user_lib> is a directory you can write to. You may need to specify lib.loc when subsequently loading the package, if <user_lib> is not in .libPaths)
See this manual for more information; R CMD INSTALL --help may also be useful
It's a less than ideal solution but it should work assuming there aren't any dependancies I've missed.

Resources