![]() |
Vital Signs MonitoringInstallation and Configuration Notes for R on Mac os XContentsQuick Recommendations (for Mac os X.5 or X.6)1. Download and install OSX.5 X.6version of R from http://cran.r-project.org/bin/macosx (http://cran.r-project.org/bin/macosx/R-2.10.0.pkg). The Startup initialization file should be located in Thanks to Mike Schenk of NOAA National Weather Service for these hints from his successful installation. His more detailed comments are below. Rcmdr Issues (tcltk and X11)Rcmdr on os X requires tcltk, a tcl toolkit, and X11, a window / graphics device. Both tcl and X11 come from unix, and os X is BSD unix and Mach kernel underneath the Mac Aqua GUI. However, not all versions of os X include both tcltk and X11 by default. My understanding is that X.5 and X.6 both include X11 by default but not tcltk. Earlier versions of os X did not install X11 by default but had it as an option. FIrst, look in applications/utilities to confirm that you have X11. If not, you can install it from your os X installation dvd. Next, install tcltk. For os X.5 and X.6, you can dowload and install tcltk from CRAN at http://cran.r-project.org/bin/macosx/tools/tcltk-8.5.5-x11.dmg. Then, from R, you can install the Rcmdr package via
When you are in R, I believe that there is an "X" or "X11" item in the menu. You might need to click it to open an X11 window (in os X.5 and X.6 the X11 window may open automatically when Rcmdr starts tcltk), then start Rcmdr in the R console with:
Rcmdr has more detailed installation notes available. Note that they give information about getting R to look more Mac-like via the tcltk version for Aqua, at the loss of the R.app GUI, or the X11 version, which runs R.app GUI but looks more unix-like. ggobi & rattleggobi is a separate program for interactive visualization of high-dimensional datasets. It also uses tcltk, which must be installed first. You can obtain tcltk from CRAN above or from the ggobi website . ggobi has a binary version available for Mac os X.5 and X.6 at their website http://www.ggobi.org/ (http://www.ggobi.org/downloads/ggobi-2.1.8.dmg)' After installing ggobi, I recommend loading the Rggobi package from CRAN.
The package rattle is another GUI that sits on top of R. It uses ggobi, tcltk, and other packages that are picked up by dependencies. If you have installed tcltk and ggobi following the above instructions, you may be able to install rattle via
and then start rattle via
More Detailed InstructionsThese are Mike Schenk's more detailed notes: There were binaries for 10.4 and 10.5 at http://cran.r-project.org/. At this point, I have not edited the Rprofile file. I launched R, and following the instructions from http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html , I typed The key seems to be that tcltk is not a default factory install from Apple. Also, X11 is needed to run R Commander. In earlier versions of OSX, X11 was an optional install also, but it seems that OSX 10.5 has it as default. With a DSL connection, the entire process took well under an hour. The longest part was downloading Rcmdr and the dependent packages. From the OSX Help file, Note that ther is a FAQ for R on Mac os on the CRAN website, and the FAQ includes installation questions. Permissions and SecurityPermissionsLike most software installation, things are easier on a Mac than under MSwin (it's the unix, stupid). os X tries for sensible default permissions on files and directories, and the binary distribuytions of R for os X use Apple's installer, so it should simply work. Firewall IssuesIt appears some agency IT policies block any access to the web via port 80 (via non-browsers). This prevents users from using the R menu to download and install new packages, as R cannot contact the CRAN repositories. I can't solve this. If your location requires a proxy server, the solution may be to add a command-line parameter http_proxy=. as suggested in the R-win FAQ at 2.19. Look in the general R FAQ as well. Contributed PackagesThere is no need to download all of the contributed packages you think you will need while you are performing the initial installation process (unless you have firewall issues noted above). Both the R GUI and Rcmdr include menu items that let you choose from a pull-down list of packages, and then automatically download and install the selected packages from a CRAN mirror. The etc/Rprofile.site file has a place to define a default CRAN mirror, or the pulldown menus let you choose among cryptically-named mirrors. If you have plenty of hard disk space and might not always have decent internet access to download a package on the fly, you might create a c:\R\packages directory and grab packages from CRAN via ftp. Keep them as .zip files: the package installation tool within R automatically processes the zip file! Note that there are over 2000 packages, so I only recommend this option if you'll be away from internet access for extended periods and do many different forms of analyses. An alternative is to download my file of packages relevant to natural resources and ecology: Install.R (drop the .txt at the end of the filename that I added so our webserver would serve the file). Open this file in a text editor (not MSword), and either comment out (by putting # at the beginning of each line) or delete blocks of packages you are not interested in, then double click on the saved file to run it in R. Alternatively, start R while you have this file open in your text editor, and simply copy and paste the blocks you want into the R command line, removing the "#" marks commenting out some of the later, less widely used sets of packages. Or, here are a couple of the blocks of packages you are most likely to want. Copy and paste each block into the R command line. Paul Geissler's Learn R Course:
Full set of Rcmdr GUI plugins:
Data manipulation:
Often the biggest difficulty is finding the packages that do what you need. If your need is ecological, a good place to start is the CRAN Task View for Environmetrics, an attempt to list common ecological analyses and the R packages available for each. [One obvious omission is mark/recapture analyses.] There are 25 task views for various fields. If that doesn't help, you can go to the main CRAN page for contributed packages and use search in your browser to search for key words for your topic. DocumentationThere are a large number of pdf documents available from CRAN at:
Note that the docs folder in your R installation directory has a manual subdirectory with pdf copies of the main R manuals available from the first of these links. I recommend creating a separate directory and downloading documents you are most likely to need, as those documents don't change with new versions of R. For more information, follow the "Good References" link in the navigation panel on the left. Updating to a New VersionNew versions of R seem to come out right after we start our R course (2.8.2 in 2008, 2.10.0 in 2009). In my experience, it has never been the case that staying with the older version was better, but most new versions have little effect on what we use. because new versions of base R usually require new versions of each package, brute force updating can be a pain. But, the developers behind R and the power users are lazy folks, so there are a couple of tools that make the process simpler. My directions are (substitute your old version for 2.9.2 and your new version for 2.10.0 in these): 1: Create a new directory for the new version of R: c:/R/R-2.10.0 2: Copy the old library directory to that new directory (c:/R/R-2.9.2/library > c:/R/R-2.10.0/library), and the old Rprofile.site file from c:/R/R-2.9.2/etc to c:/R. 3: Uninstall the old version of R (start menu | R | uninstall 2.9.2 is a bit faster than administrative tools | add/remove software) 4: Install the new version of R from cran to the new directory (c:/R/R-2.10.0) by selecting installation target c:/R. 5: Copy Rprofile.site from where you stashed it to the new etc directory (from c:/R to c:/R/R-2.10.0/etc). You probably shouldn't do this for the update from 2.92 to 2.10.0, as the CHM option for the help system is no longer supported as of 2.10.0; instead, edit the Rprofile.site file the installer builds for you by adding the local mirror and the list of packages you want loaded at startup (see above).. 6: Start R, and paste the following command at the prompt:
Alternatively, step 6 can be replaced by starting the new version of R, then selecting update packages from the packages menu. I have perhaps 50 packages installed, and the entire update process requires less than 5 minutes of my time, and then another 10 minutes of unattended running to download the updated packages (I have a slow internect connection at work).
|
|