Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Hands on R, Fall 2015 M. Dillon 1 R Installation and Setup Installing R is now very easy, regardless of your operating system. → Go to www.r-project.org, where you’ll see the R homepage (Fig 1). → Click on download R, which will take you to the “CRAN mirrors” page. What are “CRAN mirrors”, you ask? CRAN stands for “Comprehensive R Archive Network”. This is simply a bunch of computers scattered around the world that keep exact duplicates of all the files associated with R. You want to pick a mirror that is geographically close to you–this is good for both the servers (reduced load) and the users (reduced download times). You’ll do this again whenever you install packages (more on that later). Figure 1: R project homepage. → Scroll down to USA and choose one of the mirrors (I chose http://cran.fhcrc.org; like most other things, mirrors are far from Wyoming). This takes me to a download window (Fig. 2), which will look exactly the same regardless of the mirror you choose. → Choose the link for your operating system from the Download and Install R box at the top. (Source code needs to be compiled, which is probably not something you are interested in doing). Hands on R, Fall 2015 M. Dillon 2 Figure 2: Download R for your operating system from a CRAN mirror. The Linux link (Fig. 2), takes you to a page with choices for debian, redhat, suse, and ubuntu. For Ubuntu and related distributions (e.g. LinuxMint), rather than downloading from here, follow these instructions: R installation on Ubuntu. It’s nicer to have automatic installation with dependencies taken care of and with automatic updates guaranteed from the apt-source. For other linux distributions, you’re on your own. For the Mac OS X link, you will be taken to a page with a description of files, etc. Just download the R-3.2.2.pkg (which includes the GUI). Before you install it, you’ll likely want to verify the MD5 checksum to be sure the package wasn’t messed with. In the Terminal application, type: md5 R-3.0.1.pkg and compare the MD5-hash with the hash listed under the download link. If it checks out, install it like any other program on Mac. As usual, Windows is a bit more difficult. The 32-bit version should work fine on 64-bit systems and is recommended for most normal users. Choose the base link, then Download R 3.2.2 for Windows and doubleclick the file to install. For fun, you may also want to spend a few hours/days reading the R for Windows pages (not really unless you are really motivated). Notes The computers in BS 302 already have R the latest version of R installed: Start→All Programs→Statistics Programs→R x64 3.2.2 We’ll discuss installation of packages on your own computer in the first session. On the UW computer lab computers, follow the instructions on the following page from IT. How to install additional R packages on the UWStudent lab system 1. Under R folder at Start Pearl – All Programs – Statistics Programs – R run “UW Setup” a. This command creates the needed folders to allow a user to install packages to his/her network student storage space (H:\ drive) 2. Once the UW Setup is run, an R icon will be on the desktop – Launch R **NOTE – You must launch R from the Icon on the desktop in order to add packages correctly** 3. Once R is launched, go to “Packages” - “Install Packages” 4. From the list that is presented, choose the CRAN Mirror location you want to use. Usually any USA mirror has the majority of packages. 5. A complete list of packages will appear, choose the package you want to install and select OK. 6. The package will download and install to the folder location: a. H:\personal\Rfiles b. This folder can also be accessed from “My Documents” – Rfiles 7. To access the package go to Packages – Load package and select it from the list and click OK.