| STOP you might not need to do any of the things listed below. You can instead use freeNX to connect to the server from your personal computer in a way that is far simpler to setup and, for most people, much easier to use. See http://lab.demog.berkeley.edu/LabWiki for instructions on using FreeNX. The instructions below may be of slightly more than historical interest to those who like to install things and who want to maintain an independent ability to do science...from their caves..after the ApoCALypse. |
You will need the following parts:
Emacs is both and editor and a religion. You will get to know it in 213. There are many versions available for the mac, the most convenient one is Aqua Emacs. Download it from http://aquamacs.org/. Then drag it into Applications in the usual way.
The most important application is of course R. The latest version can be found and downloaded at http://cran.r-project.org/bin/macosx. Choose the latest version (currently 2.13.1); download it and run the installation program.
You can download the mac version from http://www.tug.org/mactex/2011/
Once everything is installed, let's make sure that it all works as I promised it would.
The terminal window application in the mac is very similar to the one that you run on the Linux workstations. Once you have launched a terminal window notice that you are in your home directory, and then run this command OBVIOUSLY changing ``userid'' into your own userid on the Demography Lab system.
@:
rsync -uva -e ssh userid@coale.demog.berkeley.edu:213 .
NOTE the significant dot at the end of the above command.
@:
rsync -uva -delete -e ssh ./213 userid@coale.demog.berkeley.edu:
IMPORTANT: rsync copies the contents of or the changes in the source directory onto the target directory. Which is the source and which the target is determined by order in which they appear in the command. In the above command, ./213 is the source and userid@coale.demog.berkeley.edu: (which translates to userid's home directory on coale.demog.berkeley.edu) is the target.
rsync will never change the source directory so as long as you get the source and target business right, you cannot do irreparable harm. BUT be careful with rsync, it is like a circular saw with the safety equipment removed: powerful but also dangerous.
@:
rsync -uva -delete -e ssh ./213/ userid@coale.demog.edu
NOTE also the -delete argument. In the present case this will not matter, but it tells rsync to delete files that exist in the target directory but not in the source. It is wise to use this flag because otherwise your life will fill up with useless files that you thought you had deleted already.
Although the rsync man page is very difficult to understand, it is good idea to take a look at it. (man rsync on your linux or mac machine). Since rsync can cause a huge amount of damage when used incorrectly, it is worth taking some time to figure it out. Here is one of many short tutorials: http://www.unixtutorial.org/2008/09/how-to-synchronize-directories-with-rsync/
Now let's connect to the server in such a way that you can run R inside Emacs on the server but have it behave as though you were running it locally on your PC.
Launch your X11. On most modern macs this is not necessary, X11 will launch itself when it needs to. So don't worry about it until but keep this in mind in case something goes wrong.
In a terminal window application type:
@:
ssh -X userid@coale.demog.berkeley.edu
OBVIOUSLY replace ``userid'' with your userid on the demography lab network. Answer yes to the obscure warning about not being able to establish the ``authenticity of host'' bla bla bla.
then type your password when prompted.
The ``-X'' argument in the command above tells ssh to ``tunnel X11''. To make sure that this worked type:
@:
echo $DISPLAY
If that results in localhost:10.0 (the number is not important). Then continue, otherwise, get help.
Assuming that you have a terminal window with a shell running on coale, and which is tunneling X11, then do the following:
@:
cd 213/Week1
@:
emacs 213ex1.r &
In the resulting emacs window, verify that the trivial change that you made to this file is indeed present.
If you want to, you can run all the commands in the file, but that's more boring than it's worth. To test the important feature of the X11 server, create graph in R
This should display an profoundly interesting scatter plot on your screen.
This document was generated using the LaTeX2HTML translator Version 2008 (1.71)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 0 -local_icons -no_reuse macSetup
The translation was initiated by Carl Mason on 2012-04-18