Rev 14755 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
<html lang="en"><head><title>R for Macintosh DOC/FAQ</title></head><body><h1 align="center">R for Macintosh FAQ/DOC</h1><h2>Version for <tt>R 1.3.0</tt></h2><address>S. M. Iacus</address><p>Changes specific to this version:<ul> Fixed a bug when saving from menus</ul><ul> Fixed a bug that crashes R under System 8.6 due to a callto a non-existent function under 8.6</ul><ul> Stack and memory settings changed to work on System 8.6</ul><ul> Added back the "Save" menu</ul><ul> file.choose() works correctly now</ul><ul> Now R takes track of file names associated to each window</ul><ul> Fixed a bug with printer dialog, now "cancel" works correctly</ul><ul> Now R can handle "user breaks" in evaluation and printing loops. Ruses standard MacOS control break sequence, that is "CMD + ."</ul><ul> Windows are smoothly refreshed/updated under MacOS X"</ul><ul> Now R can run AppleScript, some demo scripts are provided. See"help(applescript)" for more details</ul><p><p><hr><p><!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>rmac-FAQ.html</title></head><body><center>This is the ReadMe file of R for Macintosh Application.<p>We discuss here the following topics:</center><p>* <a href="#NEWS">NEWS</a><br>* <a href="#GUI">THE NEW GUI</a><br>* <a href="#EDITOR">EXTERNAL EDITOR INTERACTION</a><br>* <a href="#MEMORY">MEMORY</a><br>* <a href="#OPTIONS">SPECIFING OPTIONS: the .Renviron file</a><br>* <a href="#HELPERS">R HELPERS</a><br>* <a href="#REQUIREMENTS">SYSTEM REQUIREMENTS</a><br>* <a href="#FBUGS">FIXED BUGS</a><br>* <a href="#KBUGS">KNOWN BUGS</a><br>* <a href="#FAQ">SHORT FAQ</a><p><hr WIDTH="100%"><p><a NAME="NEWS"></a><b>NEWS</b><br>There are several enanchements in this release. Most of them concernthe user interface of R application but one of the most important noveltyis that now<br>R runs both on MacOS and MacOS X using Carbon technology. This meansthat when you run R from MacOS X it run natively under the new System withoutcalling the Classic Compatibility Module. The use of R under MacOS X takeslots of advantages starting from the new Aqua look.<p>As this version is based on the new Carbon technology some new bugscan appear that we were'nt able to found before releasing R officially.<p>Any feedback is then welcome at stefano.iacus@unimi.it<br> <br> <p><a NAME="GUI"></a><b>THE NEW GUI</b><br>Several menus are now present from this release. The structure of themenus is as follows with a brief description.<table BORDER=1 CELLSPACING=3 CELLPADDING=3><tr><td>Menu </td><td>Item</td><td>Shortcut</td><td>Brief description</td></tr><tr><td>Apple </td><td></td><td></td><td></td></tr><tr><td></td><td>About R </td><td> </td><td>Opens the R information dialog</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>File</td><td></td><td></td><td></td></tr><tr><td></td><td>New Edit Window </td><td>N </td><td>Opens an empty editable window. You can usethis as an internal editor for R. If the current active window isa graphic device window than a newmacintosh() device will be opened.</td></tr><tr><td> </td><td>Edit Object</td><td> E </td><td>Is the equivalent of "edit(object)"</td></tr><tr><td></td><td>Source File</td><td> O</td><td>Opens a file and sources it. This is equivalent to "source(file)"</td></tr><tr><td></td><td>Open File For Editing</td><td> </td><td>Opens a file in an editable window.Useful when you want to modify an existing script and test it.</td></tr><tr><td></td><td>File Show </td><td>F</td><td>Open a file in a non editable window. This isthe equivalent ofR command "show.file(file)"</td></tr><tr><td></td><td>Load Workspace File</td><td>L </td><td>If you want to load a wspace image otherthan ".RData"</td></tr><tr><td> </td><td>Save Workspace As</td><td></td><td>If you want to save an image file other the ".RData"</td></tr><tr><td></td><td>Page Setup</td><td></td><td> Calls the printer driver page setup</td></tr><tr><td></td><td>Print </td><td> P</td><td>Print the text window (R Console etc) or the imagein the graphic devicewindow. The image is rescaled to the page dimension of yourprinter.</td></tr><tr><td></td><td>Save</td><td> S</td><td>Save the window. This could be the content ofthe R Console i.e. yourcurrent R session any text window or the graphic device window. </td></tr><tr><td></td><td>Save As...</td><td> </td><td>Save the window. This could be the content ofthe R Console i.e. yourcurrent R session any text window or the graphicdevice window. This menuacts as a standard "Save As" menu so you have to specify each time thefilename.</td></tr><tr><td></td><td>Close </td><td> W </td><td>Closes the current window. If it is the R Consolewindow than it is interpreted as quitting R.</td></tr><tr><td></td><td>Quit</td><td> Q</td><td>This menu item is on the Apple Menu under OSX</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Edit</td><td></td><td></td><td></td></tr><tr><td></td><td>Undo</td><td> Z</td><td></td></tr><tr><td></td><td>Cut</td><td> X</td><td></td></tr><tr><td></td><td>Copy</td><td> C </td><td>If you use it on a graphic device window theimage is copied to the clipboard (see also knownbugs)</td></tr><tr><td></td><td>Paste </td><td>V</td><td></td></tr><tr><td></td><td>Copy & Paste</td><td> </td><td>You copy some text and the resultis pasted into the R Consolewindow. You use thiswhen you select a piece of R code of text windowand then you want to R to execute it. This isquite useful when you want to test part of your scriptof the examples of an help window</td></tr><tr><td> </td><td>Clear</td><td></td><td></td></tr><tr><td></td><td>Select All</td><td> A</td><td></td></tr><tr><td></td><td>Goto line</td><td></td><td> Active only for editable windows. It moves thecursor toa certain line</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Tools</td><td></td><td></td><td></td></tr><tr><td></td><td>Show Workspace</td><td></td><td> It is equivalent to "ls()"</td></tr><tr><td> </td><td>Clear Workspace</td><td></td><td> It is equivalent to "rm(list=ls())"</td></tr><tr><td></td><td>Load Workspace</td><td></td><td> Loads the ".RData" file; equivalentto load(".RData")</td></tr><tr><td></td><td>Save Workspace</td><td></td><td> Save the workspace to ".RData"; equivalentto "save.image()"</td></tr><tr><td></td><td>Load History</td><td></td><td> It is equivalent to "loadhistory()"</td></tr><tr><td></td><td>Save History </td><td></td><td>It is equivalent to "savehistory()"</td></tr><tr><td></td><td>Show History </td><td></td><td>It is equivalent to "history()"</td></tr><tr><td></td><td>Change Working Directory</td><td>D </td><td>Allows the user to change the workingdirectory by using a standarddialog</td></tr><tr><td></td><td>Show Working Directory</td><td></td><td> It is equivalent to "getwd()"</td></tr><tr><td></td><td>Reset Working Directory </td><td></td><td>It is equivalent to "setwd(R.home())"</td></tr><tr><td></td><td>Show Libraries </td><td></td><td>It is equivalent to "library()"</td></tr><tr><td> </td><td>Show DataSets </td><td></td><td> It is equivalent to "data()"</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Windows</td><td></td><td></td><td></td></tr><tr><td></td><td>R Console</td><td></td><td> This menu contains by default only the "R Console" itemand it is dynamically changed by appending/removingthenames of any new/closed window</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Help</td><td></td><td></td><td></td></tr><tr><td></td><td>R Help</td><td>? </td><td> It is equivalent to "help.start()"</td></tr><tr><td> </td><td>Help On Topic</td><td></td><td> Opens a dialog where the user canspecify an item he orshe wants to see. Equivalentto "help(topic)" or"?topic"</td></tr><tr><td></td><td>Search Help On </td><td></td><td> Opens a dialog where the user can specifyan argument tohave help on. It is equivalent to"help.search("topic")"</td></tr><tr><td> </td><td>Run An Example </td><td></td><td>Opens a dialog where the user can specifyan item of which he or shewants to run anexample of. It is equivalentto "example(topic)".</td></tr></table><i><u></u></i><p><i><u>About R windows.</u></i><br>Normally R opens windows to let 80 character/columns to be displayed.The size of the windows is calculated on the basis of the size of the fontused.<br>For non fixed fonts the algorithm can fail so the window can resulta bit larger or smaller then needed.<br>R windows are opened in cascade for each class (edit windows, fileshow windows and graphic windows). This functionality does not work onMacOS X yet.<br> <p><a NAME="EDITOR"></a><b>EXTERNAL EDITOR INTERACTION</b><br>From release 7.4.1 of the famous Alpha editor, there is a (tcl) modecalled S+/R.<br>When you open a file in Apha with the extension ".s" or ".r" this new mode will be installed and you will in the Alpha menubar the "S+/R" menu. Of this menu you can use "Process File" or "ProcessSelection" to interact with R. By default Alpha sends an open commandto R and by default R opens a file in a non editable window (equivalentto the File Show menu). If you want R to source a file you should modifythe .Renviron file accordingly (see below). In particular, the option OnOpenSourceis set by default to "FALSE". You should set it to "TRUE". You can changethis when R is still running by <a href="#OPTIONS">simply editing the .Renvironfile</a>. Use "Open File For Editing" from the "File" menu and select thefile ".Renviron". Find the keyword "OnOpenSource" and set it to "TRUE"(i.e. OnOpneSource=TRUE). The latest version of Alpha can be found at <a href="http://www.alpha.olm.net">http://www.alpha.olm.net</a><a href="http://www.alpha.olm.net"></a><p><a NAME="MEMORY"></a><b>MEMORY</b><br>Under MacOS you should reserve a fixed amount of memory to each application.As R is just an application, you need to set this to a bigger amount ofmemory if for some reason R went out of memory. To do this, go to the Finderand select the R aplication icon. Then with CMD+I key obtain the Informationfor R. Select "Memory" and the fix the amount of memeory you need. UnderMacOS X, there is no need to reserve memory for R. R will used as muchmemory as it needs.<p><a NAME="OPTIONS"></a><br><b>SPECIFING OPTIONS: </b>the .Renviron file<br>In this file you can specify some of the options. This is not standardfor general MacOS/X applications because it currently repleaces the Preferencesone should expect. But, as we have not yet decided which and what numberof preferences items the user can specify, for the time being this is theonly flexible way to take care of user options.<br>The environment file is used by R application both to simulate theenviroment on a standard Unix or Windows system and both to set user options.<br>You can always use "Sys.getenv()" to see which options are enabled/set.<br>In this file you can specify font names for the R Console and for thegraphic device as well as their sizes. The .Renviron file looks like this:an option is a "Rkey" with its "keyvalue" that you can specify in new separateline as follows RKey=keyvalue. Consider that RKey=keyvalue and RKey= keyvalue are different, that means that blanks/spaces are significant."RKey" and "keyvalue" are case sensitive. A symbol "#" at the beginningof a line means that this is a commented out line.<br>You can find more details on that in the .Renviron file itself.<p>Here are the options you can specify:<p>Lenght of the history size:<br>---------------------------<p># The history size<br># Default: RHISTSIZE=512<br>RHISTSIZE=512<p>R behaviour when R application receive a "break" event:<br>-------------------------------------------------------<p># R can handle user breaks to<br># interrupt lengthy calculations<br># or output. As this code is not<br># yet optimized, by default R<br># does not accept user breaks.<br># If the "Interrupt" switch<br># is set to TRUE then R intercept<br># user breaks. With this swtich on<br># R is a bit slower than with the<br># switch off<br># Default: Interrupt=FALSE<br> <p>R behaviour when R application receive an "open" event:<br>-------------------------------------------------------<p># Wheter to show or source a file<br># You should set this to TRUE if you<br># want Alpha be your external editor<br># Default: OnOpenSource=FALSE<br>OnOpenSource=FALSE<p>This means that when you drag a file on top of the R icon or you submitsomething from an external editor, R application simply open it (FALSE)or sources it (TRUE). If the file is a worspace image file, then R loadsthat workspace.<br> <p>Tab size of text windows:<br>-------------------------<p># The Tab size to use in text windows<br># range [1,20]<br># Default: TabSize=5<br>TabSize=5<p>Setting the text size of text and R Console windows:<br>----------------------------------------------------<p># TextSize to be used in text windows<br># range [8,14]<br># Default: TextSize=12<br>TextSize=12<p>Macintosh device resolution:<br>----------------------------<p># ScreenRes<br># Useful values is only 72. Possibile other values<br># are 144, 300, 600 but you should not use them unless<br># you know exactly what you are doing ! So, please,<br># don't change this parameter.<br># Default: ScreenRes=72<br>ScreenRes=72<p>Name of the font for the R Console or text windows:<br>---------------------------------------------------<p># FontName: this is the font used in text windows.<br># There are several possibilities for this.<br># You can specify any font you like but you should<br># prefere a monospaced font. If the Monaco will be used instead.<br># Font names are not case sensitive i.e.<br># FontName=monaco and FontName=MoNacO are the same.<br># If your font name includes spaces you should provide them<br># without using quotes, i.e.<br># FontName=Times New Roman<br># Default: FontName=monaco<br>FontName=monaco<p>Name of the font for the Macintosh graphic device:<br>--------------------------------------------------<p># GraphFontName: this font is used for graphic windows.<br># There are several possibilities for this.<br># If the font is not usable by R application, then<br># the font Helvetica will be used instead.<br># Font names are not case sensitive i.e.<br># FontName=monaco and FontName=MoNacO are the same.<br># If your font name includes spaces you should provide them<br># without including quotes, i.e.<br># FontName=Times New Roman<br># Default: GraphFontName=helvetica<br>GraphFontName=helvetica<br> <br> <p><a NAME="HELPERS"></a><b>R HELPERS</b><br>* If you want to use an external editor we suggest you to use Alphaversion 7.4.1 or newer that contains a S+/R mode. Alpha home pageis<br><a href=" http://www.alpha.olm.net"> http://www.alpha.olm.net</a><br>* You also need MacZip to use the unzip feature of R. MacZip home pageis<br> <a href="http://ww.sitec.net/maczip">http://ww.sitec.net/maczip</a><br> <br> <p><a NAME="REQUIREMENTS"></a><b>SYSTEM REQUIREMENTS</b><p>To run the R application you need at least 42MB of free memory for theapplication itself you work under MacOS but there is no limitations underMacOS X as virtual memory is always on.<br>You need the latest version of the<a href="http://asu.info.apple.com/swupdates.nsf/artnum/n11916">CarbonLiblibrary</a> from Apple. At the time of this release, version 1.2.5 is the current non developer release.Normally it is included in System 9.1 and X.<br>The minimum System version release is 8.6 (+ CarbonLib library).<br>You no longer need the WasteLib library.<p><a NAME="FBUGS"></a><b>FIXED BUGS</b><br>This version has several bugs fixed. Mostly GUI incongruencies andproblems have been resolved and few R internal numerical bugs. You havesignalled a bug but this has not yet been fixed, please "don't give up" but sendus again your feedback(<a href="malito:stefano.iacus@unimi.it">stefano.iacus@unimi.it</a>)<br> <ul><li>There was an annoying bug concerning the edit menus that on some (almost random) situations was disabled by R so no cut&paste was then possible.</li><li>Edit object on non existent R obejct produced a grabbled edit window.</li><li>Herhey fonts where not displayed correctly or at all unless the userclicked on the graphic window rotated fonts where cutted on top</li><li>Numerical problems with gamma function and polyroot. Now R pass thetests</li><li>Windows menus produced in some situations some strange</li><li>The graphic device has been completely rewritten now it is fasterand resizing of windows is handled correctly.</li><li>Copying to the clipboard images will non longer produce graphic titles/textsprinted twice.</li></ul><p><br><a NAME="KBUGS"></a><b>KNOWN BUGS</b><br> <ul><li> In some situations R stops execution giving an error like this:</li></ul> Error in plot.xy(xy.coords(x, y), type = type, pch = pch, col = col, bg= bg, :<br> negative length vectors are not allowed<br> To solve this problem you just need to resize the device window to a bigger size<br> <ul><li>On MacOS X copying to the clipboard an image or saving it in a file produces a picture without text in it. This problem is (probably) due tothe fact that the fonts we use are saved as polygons/vectors and not as images.</li><li>From version 1.2.2, at startup time you can run scripts by selecting input and output file and options (this is usefule when you want to runtests/checks). Both under MacOS and MacOS X you cannot choose a file that is outside the directory where the R application is. This problemis not due to the R application but to a bug in Sioux Interface provided by the compiler. This problem will be fixed with the next release of thecompiler.</li><li>For some reason MacZip does not intercat too much with R under MacOSX. Moreover MacZip has not yet been carbonized so when R callsit to uncompress items it also starts up Classic Environment. Wesuggest to uncompress the help and examples files directly by usingStuffit Expander that is part of the utilities provided with SystemX.</li><li> This version of R and Adobe ATM are incompatible. We are looking atthe problem. The solution is that you should switch ATM off before runningR. (Thanks to R. Gill for feedback on this bug)</li><li>Internet functionality is not available yet. We are working on this.</li><li>Mathematical expressions are not yet well spaced moreover,mathemathic symbols are not rotated.</li></ul><a NAME="FAQ"></a><b>SHORT FAQ</b><br> <br> <table BORDER COLS=2 WIDTH="100%" ><tr><td>Q</td><td>How can I work on a separate directory for each of my projects?</td></tr><tr><td>A</td><td>Under Unix you usually create a directory, go into it and launch R. Under MacOS you can create a directory and put all the files that you needthere. You then (or before) run R in its own directory and use themenu item "Tools->Change Working Directory" to change the currentworking directory to directory you have created. You can then workas you do in Unix. You can save/load workspace image to this directory,as well as the command history files. You can then reload these nexttime you work.</td></tr><tr><td>Q</td><td> How can I interrupt lengthy operations or output ?</td></tr><tr><td>A</td><td> You can now use the standard Macintosh control break sequence,that is you should press "Cmd option" plus "." (dot). This will interruptany R loops.</td></tr><tr><td>Q</td><td> How can I change memory settings for R ?</td></tr><tr><td>A</td><td> You cannot use the standard settings as on other platforms. You should assign memory to R from the Finder/Information dialog for R application. See Section "Memory" above.</td></tr></table><p><hr WIDTH="100%"><address>Last edited 2001 June 10 Stefano M. Iacus<code><ahref="mailto:stefano.iacus@unimi.it">stefano.iacus@unimi.it</a></code></address></body></html>