Sie sind auf Seite 1von 4

December, 2012

Download and install R


Introduction
This guide explains how to download and install R and then download packages that are
used for the random forest scripts. The instructions are for installing on a Windows
computer but the steps are similar for other operating systems.
1. Download and install R
R is a language and environment for statistical computing and graphics. To install R go to
the R-Project home page http!""www.r-project.org"# and click on the link to $download
R%. This will open a page with a list of several links that can be used to download the
software. &ny of these links can be used to download the software 'i.e.(
http!""cran.cnr.)erkeley.edu*. +lick on a link that is near you or that you are familiar
with. ,ext( click on the type of operating system that you use 'i.e.( - will use the
Windows version in this guide*. .n the next page click on the $base% link and then click
on the $/ownload R x.x.x% 'where x.x.x is the version number* link at the top of the
page. The download of the installation file will begin. The file is 012 3) so it can take a
while to download with a slow connection.
To install the software double-click on the file that is downloaded. This will open the R
4etup window. 5ou can add any features you like and change the installation directory
but the default selection of components and other settings works just fine.
-f the above instructions don6t work you should be able to get help from the R web site.
The download and installation process is 7uite simple and there are good support
materials on the R-Project web site.
2. Install packages to support random forest classification
& few packages 'modules that add functionality to R* need to be installed to run the
script.
To install packages it is necessary to start R. 5ou can start R by clicking on the $R% icon
that is on your desktop 'if you didn8t change the default installation* or by clicking on
4tart 9: &ll Programs 9: R 9: R ;.<1.; 'or whatever version you downloaded*. When R
starts the R +onsole window opens in side the R application window. 5ou can either type
commands into the console or for some functions use the menu at the top of the console
window.
+lick on Packages 9: -nstall package's*= This will open the $+R&, mirror% window.
4elect a location where you would like to download the packages from and then click on
the .> button. There will be a delay of several seconds and then the $Packages% window
will open. 5ou can select 'or deselect* multiple packages by holding the control '+trl*
key while clicking on packages. 4elect the following packages to download!
maptools
random?orest
raster
rgdal
sp
&fter the six packages are selected click on the $.>% button and the packages will be
installed.
&n alternative to installing the raster package from the +R&, is to download a more
recent version from the R-?orge.R repository. The version on the R-?orge site might
have additional functionality compared to the version on the +R&, but it might not have
been tested as thoroughly. To install the raster package from R-?orge type 'or cut and
paste* the following command into the R +onsole window! install.packages'@raster@(
repos9@http!""R-?orge.R-project.org@*.
-f you are using an operating system other than Windows you can use R4tudio 'described
in the next section* to install the packages listed above using the Tools 9:
-nstallAPackages... menu option.
3. Install RStudio IDE (optional)
RStudio is an open source integrated development environment for R that
provides a simple but powerful interface for Windows, Mac and Linu computers!
"ou can download RStudio from the website# http#$$www!rstudio!com$ide! "ou
need to have R installed for RStudio to wor% but &ou can use RStudio to install R
pac%ages! 'here are several helpful guides to learning to use RStudio on their
website# http#$$www!rstudio!com$ide$docs$!
Appendices
A ! "itations and license information
-f you cite this document we ask that you include the following information!
Borning( ,. ;2<;. /ownload and install R v;. &merican 3useum of ,atural Bistory(
+enter for )iodiversity and +onservation. &vailable from
http!""biodiversityinformatics.amnh.org". 'accessed on the date*.
This document is licensed under a +reative +ommons &ttribution-4hare &like C.2
Dicense. 5ou are free to alter the work( copy( distribute( and transmit the document under
the following conditions!
5ou must attribute the work in the manner specified by the author or licensor 'but
not in any way that suggests that they endorse you or your use of the work*.
-f you alter( transform( or build upon this work( you may distribute the resulting
work only under the same( similar or a compatible license.
&ny 7uestions or comment related to this document should be sent to ,ed Borning E
horningFamnh.org.
# ! Acknowledgements
We would like to thank the The Gohn /. and +atherine T. 3ac&rthur ?oundation for
supporting this effort.

Das könnte Ihnen auch gefallen