While admittedly a matter of personal taste, I like having separate  
tabs for the script and console windows, which is easily set up in  
Aquamacs with the 'tabbar' package. The following preferences file (~/ 
Library/Preferences/Aquamacs Emacs/) is bare bones and accomplishes  
the goal  as long ESS and tabbar are on the load path. It also allows  
you to display the script editor/ R console in the same frame  
(superior/inferior window)s or in a separate frame, and it adds arrow  
key bindings to move easily from one tab to the other.

At start-up,  the 5-line function(start-R) launches R-mode in the  
scratch buffer and displays the R console started by ESS in a separate  
tab.  John Fox (McMaster) also has a nice xinit file (and detailed  
instructions on how to install and revise it) to customize XEmacs,  
with a superior script window and inferior R console. Although  
intended for the windows version of XEMacs, I was able to use his file  
directly with few revisions in  Carbon Emacs, if you would rather not  
deal with the 'mac-ified' key bindings of AquaEmacs.  If his  
instructions aren't clear, feel free to write me off list if for a  
copy of the modified init file that works for Carbon Emacs. With  
either set-up, you can use the same environment for LaTeX and other  
work, which is handy. This has run without problems on 10.3.9 through  
10.5.5, G4 and Intel.

The IDE Eclipse also has a plug-in (StatET) for S-Plus and R, which  
will do what you want.  In fact, Insightful now bundles a customized  
version of Eclipse to use with their commercial S-Plus. Once you  
download Eclipse, StatET can be installed automatically via the Help  
Menu update software command (simply by entering the StatET URL 
http://download.walware.de/eclipse-3.4) 
. Although it was a bit buggy, objecting to options I set in my  
RProfile.site file, it has a nice and customizable workbench,  
particularly if you need a Java IDE.  For ease of installation and  
pretty typesetting, you might also like TeXMacs, but the separation of  
input and output isn't exactly as you describe. All of these are cross- 
platform solutions, which is a plus.

Atul

-----------------------

Atul Sharma MD, FRCP(C)
Department of Pediatrics
McGill University, Montreal QC

-----------------------------------------------


;; This is the Aquamacs Preferences file  ~/Library/Preferences/ 
Aquamacs Emacs / Preferences.el
;; Add Emacs-Lisp code here that should be executed when you start  
Aquamacs Emacs,
;; packages ESS and AUC are in "Applications/Aquamacs/Aquamacs  
Emacs.app/Contents/Resources/site-lisp/", where site files loaded  
automatically
;;----------------------------------------------

;;load ESS - explicit load  or 'require' if pckg on load path
(require 'ess-site)

;; David Ponce tabbar - revised by Nathanial Cunningham
(require 'tabbar)
;;(tabbar-mode) ;; toggled on via Options (customization.el)
(global-set-key (kbd "C-c t") 'tabbar-mode)
(global-set-key (kbd "C-c C-t") 'tabbar-local-mode)
(global-set-key [A-S-left] 'tabbar-backward)
(global-set-key [A-S-right] 'tabbar-forward) ;; notice syntax for  
arrow keys [..]
(message " C-c t toggles global tabbar, C-c C-t toggles locally")



;; set frame properties
(setq one-buffer-one-frame nil) ;; Emacs default behavior (change to  
on and get new window/buffer)
(setq initial-frame-alist '((background-color . "beige") (left . 5)  
(width .  95) (height . 40) ))
(setq default-frame-alist '((background-color . "LightYellow1")  
(left . 50) (width . 90) (height . 40)))
(setq show-paren-style 'expression) ; highlight entire expression  
inside parentheses

;;some new keybinding to send selection to R via functions in ess- 
mode.el (byte-compiled version at  /Applications/Aquamacs/Aquamacs  
Emacs.app/Contents/Resources/site-lisp/edit-modes/ess-mode/lisp/ess- 
mode.el).
(global-set-key (kbd "C-1") 'ess-eval-line-and-step)
(global-set-key (kbd "C-2") 'ess-eval-region)
(global-set-key (kbd "C-3") 'ess-eval-function-or-paragraph-and-step)
(message "Cntrl-1 bound to ess-eval-line-and-step i.e C-c C-n")
(message "Cntrl-2 bound to ess-eval-region (region = selection) i.e. C- 
c C-r")

;;---------------------------------
;; set up R window inferior R process, superior R-mode in separate tabs

(defun start-R ()
  "Start R process and name windows"
  (switch-to-buffer "*scratch" nil)
  (R-mode)
  (switch-to-buffer "*R*" nil)
  (R) )

(start-R)






On 28-Oct-08, at 7:00 AM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED] 
 > wrote:

>
>
> Message: 5
> Date: Tue, 28 Oct 2008 00:50:18 +0100
> From: Ferdinand <[EMAIL PROTECTED]>
> Subject: [R-SIG-Mac] best way to work with R on a Mac (leopard)
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> Hi,
>
> till now, I just work with the normal R environment.
> But there are some issues that disturb me working with the normal R
> console.
> I heard about alternative ways to work with R, like text editors which
> are able to communicate with R.
>
>
> What I am looking for is a way to seperate the output from the input.
>
> I think the best way would be to have two or three frames in one  
> window.
> One frame for the output, one for the input and one for just editing
> text (perhaps with R-language highlighting).
>
>
> Is there a way to realize that kind of working environment?
> And if yes, what do I need to realize that (software, preferences  
> etc.)?
>
>
>
> I tried Aquamacs Emacs.
> I can start R in Emacs with ESS but I didn't found a way to seperate
> what I type in from what I get from R as output in the way I would
> like it to be...
>
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 27 Oct 2008 17:44:40 -0700
> From: "Steven McKinney" <[EMAIL PROTECTED]>
> Subject: Re: [R-SIG-Mac] best way to work with R on a Mac (leopard)
> To: "Ferdinand" <[EMAIL PROTECTED]>,
>       <[email protected]>
> Message-ID:
>       <[EMAIL PROTECTED]>
> Content-Type: text/plain;     charset="iso-8859-1"
>

        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to