All code for this document is located at here.

Installing Neuroconductor Packages

Install and start the latest release version of R. Although the installer will try to download and install devtools, there may be some system requirements for devtools that you may need before going forward. Please visit installing devtools before going forward if you do not have devtools currently installed.

Then, you can install a package using the following command:

## try http:// if https:// URLs are supported
source("https://neuroconductor.org/neurocLite.R")
neuro_install("PACKAGE")

where PACKAGE is the name of the package you’d like to install, such as fslr. For example, if we want to install neurohcp and fslr we can run:

source("https://neuroconductor.org/neurocLite.R")
neuro_install(c("fslr", "neurohcp"))

Installing the neurocInstall package

The neurocInstall package contains the neurocLite/neuro_install functions, as well as others relevant for Neuroconductor. You can install the package as follows:

source("https://neuroconductor.org/neurocLite.R")
neuro_install("neurocInstall")

After installation, you can use neurocInstall::neurocLite() to install packages without source-ing the URL above.

Installing Stable/Current/Release Versions

Stable Versions

In Neuroconductor, there are stable versions, which correspond to a submitted package. This stable version has passed the Neuroconductor checks on Travis for Linux using the other packages in Neuroconductor that are in Neuroconductor at the time of submission. Thus, if you install this package with all the dependencies listed for this package (using specific Neuroconductor versions), it should work.

To install a stable version (which should be the default), you can run:

source("https://neuroconductor.org/neurocLite.R")
neuro_install(c("fslr", "neurohcp"), release = "stable")

Current Versions

In Neuroconductor, a “current” version mirrors the repository of the developer of the package. This does not ensure that the package is passing Neuroconductor checks, but will give you the development version from that developer. This, at least, standardizes the username for all the repositories in Neuroconductor. You can install a current version using:

source("https://neuroconductor.org/neurocLite.R")
neuro_install(c("fslr", "neurohcp"), release = "current")

Release Versions

Every few months, we snapshot all of Neuroconductor in their current forms. We save the source tarballs as well as the binary releases from Travis and Appveyor. We then host these releases on the Neuroconductor website. These downloads are stable in time and will not be changed until the next release. These downloads are also logged to show the activity/amount of use for each package of this release. To install the release, you would use:

source("https://neuroconductor.org/neurocLite.R")
neuro_install(c("fslr", "neurohcp"), release = "release")

See the release_repo argument for how to specify which release to use.

neurocLite: an alias for neuro_install

As Bioconductor uses the biocLite function to install packages, we have created a duplicate of neuro_install, called neurocLite, for ease of use for those users accustomed to Bioconductor. The same command could have been executed as follows:

source("https://neuroconductor.org/neurocLite.R")
neurocLite(c("fslr", "neurohcp"))

Installing Neuroconductor Packages without upgrading dependencies

The neurocLite/neuro_install functions depend on devtools::install_github, which will upgrade dependencies by default, which is recommended. If you would like to install a package, but not upgrade the dependencies (missing dependencies will still be installed), you can set the upgrade_dependencies argument to FALSE:

neurocLite(c("fslr", "neurohcp"), upgrade_dependencies = FALSE)

Installing and starting R

  1. Download the most recent version of R from https://cran.r-project.org/. There are detailed instructions on the R website as well as the specific R installation for the platform you are using, typically Linux, OSX, and Windows.

  2. Start R; we recommend using R through RStudio. You can start R using RStudio (Windows, OSX, Linux), typing “R” at in a terminal (Linux or OSX), or using the R application either by double-clicking on the R application (Windows and OSX).

  3. For learning R, there are many resources such as Try-R at codeschool and DataCamp.

Packages not available on Neuroconductor

If a package is not in the Neuroconductor list of packages, then it is not located on the Neuroconductor Github. Therefore, when installing, you’ll get the following error:

Error in neuro_install(...) : 
  Package(s) PACKAGE_TRIED_TO_INSTALL are not in neuroconductor

Once a package is located on the list of packages, then it will be available to install.

Session Info

devtools::session_info()
## ─ Session info ──────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 3.4.2 (2017-09-28)
##  os       macOS Sierra 10.12.6        
##  system   x86_64, darwin15.6.0        
##  ui       X11                         
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  tz       America/New_York            
##  date     2017-12-20                  
## 
## ─ Packages ──────────────────────────────────────────────────────────────
##  package     * version     date      
##  assertthat    0.2.0       2017-04-11
##  backports     1.1.1       2017-09-25
##  cli           1.0.0       2017-11-29
##  clisymbols    1.2.0       2017-06-29
##  colorout    * 1.1-0       2015-04-20
##  crayon        1.3.4       2017-10-10
##  desc          1.1.1.9999  2017-07-26
##  devtools      1.13.3.9000 2017-11-29
##  digest        0.6.13      2017-12-14
##  evaluate      0.10.1      2017-06-24
##  htmltools     0.3.6       2017-04-28
##  knitr         1.17        2017-08-10
##  magrittr      1.5         2014-11-22
##  memoise       1.1.0       2017-04-21
##  pkgbuild      0.0.0.9000  2017-11-29
##  pkgload       0.0.0.9000  2017-11-29
##  R6            2.2.2       2017-06-17
##  Rcpp          0.12.14     2017-11-23
##  rlang         0.1.4       2017-11-05
##  rmarkdown     1.8         2017-11-17
##  rprojroot     1.2         2017-01-16
##  sessioninfo   1.0.1.9000  2017-11-29
##  stringi       1.1.6       2017-11-17
##  stringr       1.2.0       2017-02-18
##  testthat      1.0.2.9000  2017-11-29
##  usethis       1.1.0.9000  2017-12-07
##  withr         2.1.0       2017-11-01
##  yaml          2.1.16      2017-12-12
##  source                                 
##  CRAN (R 3.4.0)                         
##  CRAN (R 3.4.2)                         
##  Github (r-lib/cli@ab1c3aa)             
##  Github (gaborcsardi/clisymbols@e49b4f5)
##  Github (jalvesaq/colorout@1539f1f)     
##  Github (gaborcsardi/crayon@b5221ab)    
##  Github (muschellij2/desc@d35a9db)      
##  Github (hadley/devtools@54498b6)       
##  CRAN (R 3.4.2)                         
##  CRAN (R 3.4.1)                         
##  CRAN (R 3.4.0)                         
##  CRAN (R 3.4.1)                         
##  CRAN (R 3.4.0)                         
##  CRAN (R 3.4.0)                         
##  Github (r-lib/pkgbuild@a70858f)        
##  Github (r-lib/pkgload@70eaef8)         
##  CRAN (R 3.4.0)                         
##  CRAN (R 3.4.3)                         
##  CRAN (R 3.4.2)                         
##  CRAN (R 3.4.2)                         
##  CRAN (R 3.4.0)                         
##  Github (r-lib/sessioninfo@c871d01)     
##  CRAN (R 3.4.2)                         
##  CRAN (R 3.4.0)                         
##  Github (hadley/testthat@6dabfd2)       
##  Github (r-lib/usethis@3de3ac7)         
##  CRAN (R 3.4.2)                         
##  CRAN (R 3.4.2)

References