I have been using ipython notebook to run some R scripts. Now the problem is I have two R versions on my Ubuntu 14.04.
One is R.3.2.2 at /home/MYNAME/anaconda2/bin/R, another one is the R which I need for R studio,
now the problem is I want to only use R.3.3.1 for my system as I need some advanced task to be done.
I use conda uninstall r, after running this, according to the print out, a lot of R related packages is removed, if i run conda uninstall r again, it said
Fetching package metadata .......
Using Anaconda Cloud api site https://api.anaconda.org
Solving package specifications: ..........
Error: no packages found to remove from environment: /home/MyName/anaconda2
but when I run Which R again, still it is the anaconda R, if I run R in the terminal, it is still R3.2.2, anyone knows how could I remove this anaconda R version?
You probably needed to run hash -r in your session (or rehash if using zsh) to update your executables on PATH for the which command. A new terminal session would also fix the problem.
you can try conda uninstall r-base, this will remove R and all of the R-library.
The questions also implies that one cannot use anaconda R with rstudio.
On Linux you can
export RSTUDIO_WHICH_R=/home/USER/anaconda3/bin/R
and add to .profile (d/o your distro) to use rstudio with anaconda R and packages
Related
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.
I tried to install R Studio (version 1.1.456) using the anaconda navigator by simply clicking on the install button. It was taking more than an hour, so I just figured it should be stuck.
I then tried to install it through the anaconda prompt but now it has also been stuck for around 30 minutes here:
What can I do to get around this?
Thank you in advance!
For various reasons up-to-date RStudio versions are not availabe on any conda channel I know. #merv's answer is the easiest solution, if you are happy to work with an older version of rstudio. Here is another suggestion, where you install RStudio outside of conda, but configure it to use a particular R installation, which is maintained in your custom conda environment. Step by step, this is how you procede:
Install the latest RStudio from the official sources
Create your custom conda environment CUSTOMENV, including an installation of r-base
conda create -n CUSTOMENV -c conda-forge r-base'>=4.0.0' ... [further packages]
Activate the conda environment
conda activate CUSTOMENV
Start RStudio from console
rstudio &
Important Note: I strongly endorse #mfakaehler's answer since all RStudio builds on Conda have effectively been abandoned. Install RStudio natively and launch from activated environment.
Create a new env instead. E.g.,
conda create --name rstudio_env -c r rstudio
Best practice for Conda is to create new envs for each project rather than using a monolithic base env. Generally, I find that the less one installs in base the better their experience with Conda will be.
I just downloaded anaconda and downloaded their basic R package.
I also got some packages from anaconda, using the anaconda terminal commands that they provide on their website.
My question is -- when I am starting a new R session in r studio, do I still need to install.packages()? Can I just load the package?
When I press libary(rJava) for example -- the R command line doesn't say anything back on whether it was successful, that's why I'm not sure. Thanks.
if you have installed the R packages via the R command line then you can just directly load them. I would recommend that you use the command line rather than R studio.
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/
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()