• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.



Page history last edited by PBworks 14 years, 8 months ago

How to get R packages


R has many "packages" each of which contain a number of useful functions. When you load a package it takes up some memory. Hence to be efficient with memory these packages are not pre-loaded into R. When you discover you need a certain package you can download it (step 1 below). You only install it into R (step 2 below) when you need it.


The process works like this:


STEP 1 - download package

  • You discover you need a package (say RODBC for example)
  • Click on "Packages" in the R toolbar
  • Click on "Install Packages" in the submenu
  • Choose a CRAN mirror we recommend one of the two UK locations if you are in the UK
  • A list of available packages is generated; click on the package you need


So far what you have done is to download the package onto you machine or network. You only need to do this once....


...however, the package has not been loaded into R yet, and this stage you do every time you need it. (You can always write functions with "require(PackageName)" as the first line so this will happen automatically.).


STEP 2 - load package into R

  • Click on "Packages" in the R toolbar
  • Click "Load Package"
  • You'll get a list of all the packages on you machine; note if the package you want isnt there you need to go back to step 1
  • Click on the required package


That's it!

Comments (0)

You don't have permission to comment on this page.