Check this by loading some basic libraries library(ggplot2) or library(dplyr). Platform: x86_64-apple-darwin13.4.0 (64-bit)īecause we created this R environment and specified r-essentials, many popular packages have already been loaded. The first line after typing R should be: R version 3.5.1 () - "Feather Spray"Ĭopyright (C) 2018 The R Foundation for Statistical Computing I got this error using anything >10.10 on Mac OS X. IF you got an error about the “java” command-line tool, visit this site to fix it. We can check the version of R in two ways.įirst, launch R by typing R, you should see R version 3.5.1 (“Feather Spray”) load. Check that the correct R version is running Your terminal prompt should now be preceded by your conda environment name, in this case (r_3.5.1), and the asterisk should be listed next to r_3.5.1 rather than basein the conda info -envs output. ![]() To activate your newly created R environment type: source activate r_3.5.1 You should now see the new environment listed: base * /Users/shu/anaconda3 Now, list your conda environments again with conda info -envs. # To deactivate an active environment, use: This installation will take a few minutes and at the end you should see something like the following: pip 19.1# | 100% A full list of packages available for conda install. r-essentials is a package bundle which has a lot of the most basic and commonly used R packages. ‘r-essentials’, upon installing R-related packages, you need to add ‘r-’ ahead of the package name.Without this last part, conda will automatically install the most recent version of R. In this particular case, we also specify r=3.5.1. ’-c r r=3.5.1’ specifies to use the ‘r’ channel for installation.‘conda create –name r_3.5.1’ creates a new conda environment that will be called ‘r_3.5.1’.conda create -name r_3.5.1 -c r r=3.5.1 r-essentials Additionally, your command line will be preceded with ‘(base)’ to denote you are in your base conda environment.įirst, we will generate a specific R environment for R v3.5.1 (most recent version available through Anaconda, as of April 2019). An asterisk will denote where you currently are, likely ‘base’. The output should list all the conda environments you have created. Creating a conda environment for Rįirst, list the conda environments you have locally: conda info -envs More info on getting started with conda here.Ĭonda environments have been widely adopted as a means of facilitating reproducible computation across the Python ecosystem– but is now expanding to include other programming languages such as R (more here).īelow, documents how I have built up conda environments to run specific versions of R, including RStudio and jupyter notebooks. For this, we created and shared a conda environment. It is key that my collaborator and I maintain the same versions of software, so code that we write individually can be easily shared. For instance, I’m working on a collaborative project which requires building bioinformatic pipelines with several different programs. You can use these conda environments in any number of ways– they can be program-specific (for the running of one specific tool) or project-specific (to store versions for a whole workflow). ![]() ![]() You can google ‘conda install for software X’, and often find a single line command to install the most recent version of that software.Įven better, Anaconda allows you to create compartmentalized computational environments (called “conda environments” in this post) where you can install any mixture of things you require without accidentally messing up other software downloads on your computer. Anaconda will make your scientific programming life easier by facilitating software installations for many programs or packages. # Location on my computer: /Users/shu/anaconda3īriefly, Anaconda, or conda, is a software package manager. Once you have Anaconda installed, check the version. If you do not have Anaconda, follow instructions here to install. Installing Anacondaįirst, let’s make sure Anaconda is installed. After doing some digging, I decided to give Anaconda environments a try to have the ability to run different versions of R and do this across R on the command line, RStudio, and jupyter notebooks (IRKernel). I recently found myself setting up a new computer, spinning up ~23864283.34 new projects in R, and wanting to stay somewhat organized in the process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |