Skip to content

R editor for Mac

16 messages · Kristina Krsteva, Andrew Beckerman, Gerald Jurasinski +7 more

#
Kristina

The mac installation of R comes with a brilliant script editor built right in.

Just start R, choose file->new to open a script and you are away. 

There is line numbering, coloured context for functions etc, smart brackets and quotes and keystrokes to send the code you select to the console:

cmd+return to send selected text or the line you are on.

You've got all you need to get started quickly (and perhaps all you need), courtesy of the excellent development team for the mac.

Good luck.
Andrew
++++++++++++++++++++++++++++++++++++
Dr. Andrew Beckerman
Department of Animal and Plant Sciences
University of Sheffield
Sheffield S10 2TN
UK

a.beckerman at sheffield.ac.uk
http://www.beckslab.staff.shef.ac.uk
On 26 Jan 2011, at 20:16, Kristina Krsteva wrote:

            
#
I use vim-r-plugin to interact with r.app,

Emacs lovers will recommend ess I think.
On Jan 26, 2011, at 8:16 PM, Kristina Krsteva <kkrsteva at gmail.com> wrote:

            
#
Hi Kristina,

The standard R.app is really everything you need. Build in syntax highlighting, command forwarding, function preview, package installation, managing, and loading etc. makes working with it really easy. However, if you still insist on an "external" editor try JGR (read JaguaR).

All the best
Gerald

??????????????????

Dr. Gerald Jurasinski
Landscape Ecology and Site Evaluation
Institute for Management of Rural Areas
Faculty of Agricultural and Environmental Sciences
University of Rostock
Justus-von-Liebig-Weg 6
18059 Rostock
Germany

gerald.jurasinski at uni-rostock.de
http://www.auf.uni-rostock.de/loe
+49 381 4983225 (tel)
+49 381 4983222 (fax)


Am 26.01.2011 um 21:16 schrieb Kristina Krsteva:
#
I agree the built-in editor works well.

I?ll add that I work entirely in Textmate.

In addition to the built-in editor?s features such as command execution, it offers

Flexible execution (run in R.app; run in a daemon, return to clipboard, return to this document, return as tool-tip etc
Snippets (your own tab-completable smart-typing function insertion)
Commands: convert a list of numbers to an Rvector  or matrix; drop-down menu for par() parameters (cmd-;)? the list is endless and incredibly helpful
Code-folding (so you can collapse long function etc.
Wide choice of syntax highlighting schemes
On 26 Jan 2011, at 8:27 PM, Andrew Beckerman wrote:

            
cheers,
tim

Timothy   Bates
Professor of Individual Differences in Psychology
University   of   Edinburgh
7 George Square EH8 9JZ
+44.131 651 1945
#
One can also use aquamacs with ESS: http://aquamacs.org/features.shtml, but I find it quite slow compared to the built-in editor. 

--
Christophe Dutang
Ph.D. student at ISFA, Lyon, France
website: http://dutangc.free.fr

Le 27 janv. 2011 ? 11:10, Timothy Bates a ?crit :
#
I suggest just use one's favorite text editor and execute the code in R.app or terminal (some integration between them will be nice). Sometime things can go wrong, for example a segment of code takes unusual long time or large memory, and then R got frozen. In this case I can usually force R to quite if it does not response. But if I run the code within some editor, then I had to force quite the editor and probably lose all the code I just wrote.

Maybe just I have such  problems from time to time...
On Jan 27, 2011, at 10:25 AM, Christophe Dutang wrote:

            
#
I agree, I (generally) adore using the R.app.
(I also use Keyboard Maestro to add a couple of extra conveniences,
like mimicking the behavior of control-R from windows (submitting, then advancing
to the next line), or indenting/de-indenting a block.)

I do have problems with occasional crashes or freezes, 
or editing windows that no longer respond,
apparently when the R.app editor gets
confused in its attempt to do the nice formatting respecting quotes.
Sometimes I can unfreeze a frozen R session by sending a signal from the unix terminal:

kill -4 PID
where PID is the process id obtained from the unix command ps -ax | egrep 'R.app|R64.app'  | awk '{print $1}'
(Safe, I think, when you've only got one R running.)

 
Roger Day
University of Pittsburgh Departments of Biomedical Informatics and  
Biostatistics
University of Pittsburgh Cancer Institute
University of Pittsburgh Molecular Medicine Institute
-----------------------------------------------------
Room 310, Suite 301
Cancer Pavilion (CNPAV)
5150 Centre Ave.
Pittsburgh, PA 15232
e-mail:  day01 at pitt.edu
cell phone 412-609-3918
assistant:
    Lucy Cafeo:       (412) 623-2952
-----------------------------------------------------
On Jan 27, 2011, at 1:23 AM, Gerald Jurasinski wrote:

            
1 day later
#
Dear All,

Although this question was asked and answered many times, one editor was 
never mentioned:

As a long-time Mac user I prefer "nedit" for the following reasons:

- it was developed by people who wanted to have a Mac-like editor on Linux

- it is almost as powerful as emacs but much easier to use and much faster

- it has built-in syntax highlighting for many languages

- it has also syntax highlighting for R, simply install "R-5.3.pats" 
(which I attach)

- it is incredible fast, e.g.:

   -- it can open text files of sizes larger than 500 MB in few seconds
      (e.g. the Affymetrix annotation file 
HuEx-1_0-st-v2.na31.hg19.probeset.csv)

   -- searching such large files is also incredible fast

   -- it opens a C++ source code with 10,000 lines immediately (in 
contrast to emacs)

For these reasons I use nedit daily since more than 10 years on both 
Linux and Mac.

Best regards
Christian
_._._._._._._._._._._._._._._._._._
C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
V.i.e.n.n.a           A.u.s.t.r.i.a
e.m.a.i.l:        cstrato at aon.at
_._._._._._._._._._._._._._._._._._

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: R-5.3.pats
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20110129/fd4b342c/attachment.pl>
#
Holding the option key while selecting text, you can select the columns. This is built into the Mac OS X and available in many Mac "native" text editor like textmate, textwrangler, bbedit, etc, even the system's TextEdit can do that.

Meanwhile Vim can do column selection with the blockwise-visual (CTRL-V is the default shortcuts). I don't use Emacs but heard it can do it, too. So select, copy paste and replace columns is nothing special at all.
On Jan 29, 2011, at 2:04 PM, Gang Chen wrote:

            
#
On Jan 29, 2011, at 2:47 PM, cstrato wrote:

            
You could check whether the appropriate modification to the  
AppleScripts presented at Dietrich's webpage  for TextWrangler and  
SubEthaEdit would do the trick:

http://www.formatio-reticularis.de/r-mac-editor.html
#
Dear David,

Thank you for this information, I will check it.

Best regards
Christian
On 1/29/11 9:40 PM, David Winsemius wrote: