R command history on unix version
1
0
Entering edit mode
Jianping Jin ▴ 890
@jianping-jin-1212
Last seen 9.6 years ago
Dear list: On the Windows version one can bring back R command history at the prompt by using a up-ward arrow key. Unfortunately I can not do the same thing on a Sun unix machine. I am wondering if one can set up the history function or command editing function, what ever you call that, with the unix version of R? Thanks in advance! Jianping xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x Jianping Jin Ph.D. x x Bioinformatics scientist x x Center for bioinformatics x x 3133 Bioinformatics Building x x CB# 7104 x x University of North Carolina x x Chapel Hill, NC 27599 x x Tel: (919)843-6105 x x Fax: (919)843-3103 x x E-mail: jjin at email.unc.edu x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
• 1.4k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 7 hours ago
United States
Hi Jianping, Jianping Jin wrote: > Dear list: > > On the Windows version one can bring back R command history at the prompt > by using a up-ward arrow key. Unfortunately I can not do the same thing on > a Sun unix machine. I am wondering if one can set up the history function > or command editing function, what ever you call that, with the unix version > of R? It depends on how you run R. If you are running at a terminal prompt, then I think you have to have readline installed. In that case, you can use up and down arrows just like on win32. However, running at a terminal is IMO really not the way to do things. I much prefer to use Xemacs/ESS with R as an inferior process. In that case you can use M-p and M-n (Alt-p and Alt-n for non-(X)emacs folks) to go up and down in the history. On win32, adding this to my init.el file makes the up and down arrows work just like the Rgui, but doesn't seem to work on Linux. (eval-after-load "comint" '(progn (setq comint-scroll-to-bottom-on-output 'others) ; not current ;;=default: (setq comint-scroll-to-bottom-on-input nil) (setq comint-scroll-show-maximum-output t) ;;; this is the key (define-key comint-mode-map [up] 'comint-previous-matching-input-from-input) (define-key comint-mode-map [down] 'comint-next-matching-input-from-input) (define-key comint-mode-map "\C-a" 'comint-bol))) HTH, Jim > > Thanks in advance! > > Jianping > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > x Jianping Jin Ph.D. x > x Bioinformatics scientist x > x Center for bioinformatics x > x 3133 Bioinformatics Building x > x CB# 7104 x > x University of North Carolina x > x Chapel Hill, NC 27599 x > x Tel: (919)843-6105 x > x Fax: (919)843-3103 x > x E-mail: jjin at email.unc.edu x > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD COMMENT
0
Entering edit mode
Thanks James! There are something that I am not sure yet and please take a look at below. --On Wednesday, June 14, 2006 10:54 AM -0400 "James W. MacDonald" <jmacdon at="" med.umich.edu=""> wrote: > Hi Jianping, > > Jianping Jin wrote: >> Dear list: >> >> On the Windows version one can bring back R command history at the >> prompt by using a up-ward arrow key. Unfortunately I can not do the >> same thing on a Sun unix machine. I am wondering if one can set up the >> history function or command editing function, what ever you call that, >> with the unix version of R? > > It depends on how you run R. If you are running at a terminal prompt, I get access to R of unix version (on a Sunny computer) from my desk top (running Windows XP) through SSH secure shell. > then I think you have to have readline installed. In that case, you can readline is available on our server side. Do I need to ask a system administer to re-compile R with adding readline? > use up and down arrows just like on win32. However, running at a terminal > is IMO really not the way to do things. I much prefer to use Xemacs/ESS > with R as an inferior process. In that case you can use M-p and M-n > (Alt-p and Alt-n for non-(X)emacs folks) to go up and down in the history. I added Xemacs to my account on the server and was able to initiate the Xemacs:*scratch* window. But I do not know how to run R from within Xemacs. I can type commands and initiate xterm window. It gave me an error message, however, when I tried to run R on the Xemacs Shell command: "fatal error: you must specify '--save', '--no-save' or '--vanilla'". > > On win32, adding this to my init.el file makes the up and down arrows > work just like the Rgui, but doesn't seem to work on Linux. On my desktop computer I did not find any file called init.el to which I can add your script. Is this an alternative to the two ways described above? I greatly appreciate your help! Jianping > > (eval-after-load > "comint" > '(progn > (setq comint-scroll-to-bottom-on-output 'others) ; not current > ;;=default: (setq comint-scroll-to-bottom-on-input nil) > (setq comint-scroll-show-maximum-output t) ;;; this is the key > (define-key comint-mode-map [up] > 'comint-previous-matching-input-from-input) > (define-key comint-mode-map [down] > 'comint-next-matching-input-from-input) > > (define-key comint-mode-map "\C-a" 'comint-bol))) > > HTH, > > Jim > > >> >> Thanks in advance! >> >> Jianping >> >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> x Jianping Jin Ph.D. x >> x Bioinformatics scientist x >> x Center for bioinformatics x >> x 3133 Bioinformatics Building x >> x CB# 7104 x >> x University of North Carolina x >> x Chapel Hill, NC 27599 x >> x Tel: (919)843-6105 x >> x Fax: (919)843-3103 x >> x E-mail: jjin at email.unc.edu x >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor > > > -- > James W. MacDonald, M.S. > Biostatistician > Affymetrix and cDNA Microarray Core > University of Michigan Cancer Center > 1500 E. Medical Center Drive > 7410 CCGC > Ann Arbor MI 48109 > 734-647-5623 > > > ********************************************************** > Electronic Mail is not secure, may not be read every day, and should not > be used for urgent or sensitive issues. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x Jianping Jin Ph.D. x x Bioinformatics scientist x x Center for bioinformatics x x 3133 Bioinformatics Building x x CB# 7104 x x University of North Carolina x x Chapel Hill, NC 27599 x x Tel: (919)843-6105 x x Fax: (919)843-3103 x x E-mail: jjin at email.unc.edu x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ADD REPLY
0
Entering edit mode
Jianping Jin wrote: > readline is available on our server side. Do I need to ask a system > administer to re-compile R with adding readline? I don't think so. If readline was installed when R was compiled, I think you should be good. > >> use up and down arrows just like on win32. However, running at a terminal >> is IMO really not the way to do things. I much prefer to use Xemacs/ESS >> with R as an inferior process. In that case you can use M-p and M-n >> (Alt-p and Alt-n for non-(X)emacs folks) to go up and down in the >> history. > > > I added Xemacs to my account on the server and was able to initiate the > Xemacs:*scratch* window. But I do not know how to run R from within > Xemacs. I can type commands and initiate xterm window. It gave me an > error message, however, when I tried to run R on the Xemacs Shell > command: "fatal error: you must specify '--save', '--no-save' or > '--vanilla'". > Do you have ESS installed in your Xemacs? See here for more information: http://ess.r-project.org/ >> >> On win32, adding this to my init.el file makes the up and down arrows >> work just like the Rgui, but doesn't seem to work on Linux. > > > On my desktop computer I did not find any file called init.el to which I > can add your script. Is this an alternative to the two ways described > above? This file doesn't exist until you make one. John Fox has been nice enough to make a very detailed instruction manual for win32 here: http://socserv.mcmaster.ca/jfox/Books/Companion/ESS/ Best, Jim > > I greatly appreciate your help! > > Jianping > >> >> (eval-after-load >> "comint" >> '(progn >> (setq comint-scroll-to-bottom-on-output 'others) ; not current >> ;;=default: (setq comint-scroll-to-bottom-on-input nil) >> (setq comint-scroll-show-maximum-output t) ;;; this is the key >> (define-key comint-mode-map [up] >> 'comint-previous-matching-input-from-input) >> (define-key comint-mode-map [down] >> 'comint-next-matching-input-from-input) >> >> (define-key comint-mode-map "\C-a" 'comint-bol))) >> >> HTH, >> >> Jim >> >> >>> >>> Thanks in advance! >>> >>> Jianping >>> >>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>> x Jianping Jin Ph.D. x >>> x Bioinformatics scientist x >>> x Center for bioinformatics x >>> x 3133 Bioinformatics Building x >>> x CB# 7104 x >>> x University of North Carolina x >>> x Chapel Hill, NC 27599 x >>> x Tel: (919)843-6105 x >>> x Fax: (919)843-3103 x >>> x E-mail: jjin at email.unc.edu x >>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: >>> http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> >> >> -- >> James W. MacDonald, M.S. >> Biostatistician >> Affymetrix and cDNA Microarray Core >> University of Michigan Cancer Center >> 1500 E. Medical Center Drive >> 7410 CCGC >> Ann Arbor MI 48109 >> 734-647-5623 >> >> >> ********************************************************** >> Electronic Mail is not secure, may not be read every day, and should not >> be used for urgent or sensitive issues. > > > > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > x Jianping Jin Ph.D. x > x Bioinformatics scientist x > x Center for bioinformatics x > x 3133 Bioinformatics Building x > x CB# 7104 x > x University of North Carolina x > x Chapel Hill, NC 27599 x > x Tel: (919)843-6105 x > x Fax: (919)843-3103 x > x E-mail: jjin at email.unc.edu x > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD REPLY
0
Entering edit mode
Hi James, The readline worked pretty well. Thanks a lot! best, Jianping --On Wednesday, June 14, 2006 3:14 PM -0400 "James W. MacDonald" <jmacdon at="" med.umich.edu=""> wrote: > Jianping Jin wrote: >> readline is available on our server side. Do I need to ask a system >> administer to re-compile R with adding readline? > > I don't think so. If readline was installed when R was compiled, I think > you should be good. > >> >>> use up and down arrows just like on win32. However, running at a >>> terminal is IMO really not the way to do things. I much prefer to use >>> Xemacs/ESS with R as an inferior process. In that case you can use M-p >>> and M-n (Alt-p and Alt-n for non-(X)emacs folks) to go up and down in >>> the history. >> >> >> I added Xemacs to my account on the server and was able to initiate the >> Xemacs:*scratch* window. But I do not know how to run R from within >> Xemacs. I can type commands and initiate xterm window. It gave me an >> error message, however, when I tried to run R on the Xemacs Shell >> command: "fatal error: you must specify '--save', '--no-save' or >> '--vanilla'". >> > > Do you have ESS installed in your Xemacs? See here for more information: > > http://ess.r-project.org/ > >>> >>> On win32, adding this to my init.el file makes the up and down arrows >>> work just like the Rgui, but doesn't seem to work on Linux. >> >> >> On my desktop computer I did not find any file called init.el to which I >> can add your script. Is this an alternative to the two ways described >> above? > > This file doesn't exist until you make one. John Fox has been nice enough > to make a very detailed instruction manual for win32 here: > > http://socserv.mcmaster.ca/jfox/Books/Companion/ESS/ > > Best, > > Jim > > >> >> I greatly appreciate your help! >> >> Jianping >> >>> >>> (eval-after-load >>> "comint" >>> '(progn >>> (setq comint-scroll-to-bottom-on-output 'others) ; not current >>> ;;=default: (setq comint-scroll-to-bottom-on-input nil) >>> (setq comint-scroll-show-maximum-output t) ;;; this is the key >>> (define-key comint-mode-map [up] >>> 'comint-previous-matching-input-from-input) >>> (define-key comint-mode-map [down] >>> 'comint-next-matching-input-from-input) >>> >>> (define-key comint-mode-map "\C-a" 'comint-bol))) >>> >>> HTH, >>> >>> Jim >>> >>> >>>> >>>> Thanks in advance! >>>> >>>> Jianping >>>> >>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>>> x Jianping Jin Ph.D. x >>>> x Bioinformatics scientist x >>>> x Center for bioinformatics x >>>> x 3133 Bioinformatics Building x >>>> x CB# 7104 x >>>> x University of North Carolina x >>>> x Chapel Hill, NC 27599 x >>>> x Tel: (919)843-6105 x >>>> x Fax: (919)843-3103 x >>>> x E-mail: jjin at email.unc.edu x >>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>>> >>>> _______________________________________________ >>>> Bioconductor mailing list >>>> Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>>> Search the archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >>> >>> >>> -- >>> James W. MacDonald, M.S. >>> Biostatistician >>> Affymetrix and cDNA Microarray Core >>> University of Michigan Cancer Center >>> 1500 E. Medical Center Drive >>> 7410 CCGC >>> Ann Arbor MI 48109 >>> 734-647-5623 >>> >>> >>> ********************************************************** >>> Electronic Mail is not secure, may not be read every day, and should not >>> be used for urgent or sensitive issues. >> >> >> >> >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> x Jianping Jin Ph.D. x >> x Bioinformatics scientist x >> x Center for bioinformatics x >> x 3133 Bioinformatics Building x >> x CB# 7104 x >> x University of North Carolina x >> x Chapel Hill, NC 27599 x >> x Tel: (919)843-6105 x >> x Fax: (919)843-3103 x >> x E-mail: jjin at email.unc.edu x >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > > > -- > James W. MacDonald, M.S. > Biostatistician > Affymetrix and cDNA Microarray Core > University of Michigan Cancer Center > 1500 E. Medical Center Drive > 7410 CCGC > Ann Arbor MI 48109 > 734-647-5623 > > > ********************************************************** > Electronic Mail is not secure, may not be read every day, and should not > be used for urgent or sensitive issues. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x Jianping Jin Ph.D. x x Bioinformatics scientist x x Center for bioinformatics x x 3133 Bioinformatics Building x x CB# 7104 x x University of North Carolina x x Chapel Hill, NC 27599 x x Tel: (919)843-6105 x x Fax: (919)843-3103 x x E-mail: jjin at email.unc.edu x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ADD REPLY
0
Entering edit mode
Jianping: your Sun system may or may not have compiled with readline. If you want to make sure do this: # R RHOME this will give you the location of R. Change to this directory, look in the config.log file (search eg. for Source by doing /Source in less) for something like R is now configured for x86_64-unknown-linux-gnu Source directory: . Installation directory: /usr/local C compiler: gcc -g -O2 -std=gnu99 Fortran 77 compiler: g77 -g -O2 C++ compiler: g++ -g -O2 Fortran 90/95 compiler: g77 -g -O2 Interfaces supported: X11, tcltk External libraries: readline, BLAS(ATLAS) Additional capabilities: PNG, JPEG, iconv, MBCS, NLS Options enabled: shared library, R profiling Recommended packages: yes Readline should be listed here. If not, your sysadmins need to recompile. If it is listed you probably have some problems with your terminal connection. Do your arrow keys work in the shell? Running R from ESS/Emacs is of course the best way to go, but if you are new to Emacs get ready fro a rough ride. It _will_ take quite some time to get comfortable doing this... Note that in your case you will be running R remotely inside a local Emacs, which is slightly different than what most guides talk about (which is running local R in local Emacs). How to setup X(Emacs) and ESS is off-topic for this list. Try the ESS help list. /Kasper On Jun 14, 2006, at 12:14 PM, James W. MacDonald wrote: > Jianping Jin wrote: >> readline is available on our server side. Do I need to ask a system >> administer to re-compile R with adding readline? > > I don't think so. If readline was installed when R was compiled, I > think > you should be good. > >> >>> use up and down arrows just like on win32. However, running at a >>> terminal >>> is IMO really not the way to do things. I much prefer to use >>> Xemacs/ESS >>> with R as an inferior process. In that case you can use M-p and M-n >>> (Alt-p and Alt-n for non-(X)emacs folks) to go up and down in the >>> history. >> >> >> I added Xemacs to my account on the server and was able to >> initiate the >> Xemacs:*scratch* window. But I do not know how to run R from within >> Xemacs. I can type commands and initiate xterm window. It gave me an >> error message, however, when I tried to run R on the Xemacs Shell >> command: "fatal error: you must specify '--save', '--no-save' or >> '--vanilla'". >> > > Do you have ESS installed in your Xemacs? See here for more > information: > > http://ess.r-project.org/ > >>> >>> On win32, adding this to my init.el file makes the up and down >>> arrows >>> work just like the Rgui, but doesn't seem to work on Linux. >> >> >> On my desktop computer I did not find any file called init.el to >> which I >> can add your script. Is this an alternative to the two ways described >> above? > > This file doesn't exist until you make one. John Fox has been nice > enough to make a very detailed instruction manual for win32 here: > > http://socserv.mcmaster.ca/jfox/Books/Companion/ESS/ > > Best, > > Jim > > >> >> I greatly appreciate your help! >> >> Jianping >> >>> >>> (eval-after-load >>> "comint" >>> '(progn >>> (setq comint-scroll-to-bottom-on-output 'others) ; not >>> current >>> ;;=default: (setq comint-scroll-to-bottom-on-input nil) >>> (setq comint-scroll-show-maximum-output t) ;;; this is the >>> key >>> (define-key comint-mode-map [up] >>> 'comint-previous-matching-input-from-input) >>> (define-key comint-mode-map [down] >>> 'comint-next-matching-input-from-input) >>> >>> (define-key comint-mode-map "\C-a" 'comint-bol))) >>> >>> HTH, >>> >>> Jim >>> >>> >>>> >>>> Thanks in advance! >>>> >>>> Jianping >>>> >>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>>> x Jianping Jin Ph.D. x >>>> x Bioinformatics scientist x >>>> x Center for bioinformatics x >>>> x 3133 Bioinformatics Building x >>>> x CB# 7104 x >>>> x University of North Carolina x >>>> x Chapel Hill, NC 27599 x >>>> x Tel: (919)843-6105 x >>>> x Fax: (919)843-3103 x >>>> x E-mail: jjin at email.unc.edu x >>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>>> >>>> _______________________________________________ >>>> Bioconductor mailing list >>>> Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>>> Search the archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >>> >>> >>> -- >>> James W. MacDonald, M.S. >>> Biostatistician >>> Affymetrix and cDNA Microarray Core >>> University of Michigan Cancer Center >>> 1500 E. Medical Center Drive >>> 7410 CCGC >>> Ann Arbor MI 48109 >>> 734-647-5623 >>> >>> >>> ********************************************************** >>> Electronic Mail is not secure, may not be read every day, and >>> should not >>> be used for urgent or sensitive issues. >> >> >> >> >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> x Jianping Jin Ph.D. x >> x Bioinformatics scientist x >> x Center for bioinformatics x >> x 3133 Bioinformatics Building x >> x CB# 7104 x >> x University of North Carolina x >> x Chapel Hill, NC 27599 x >> x Tel: (919)843-6105 x >> x Fax: (919)843-3103 x >> x E-mail: jjin at email.unc.edu x >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > > > -- > James W. MacDonald, M.S. > Biostatistician > Affymetrix and cDNA Microarray Core > University of Michigan Cancer Center > 1500 E. Medical Center Drive > 7410 CCGC > Ann Arbor MI 48109 > 734-647-5623 > > > ********************************************************** > Electronic Mail is not secure, may not be read every day, and > should not be used for urgent or sensitive issues. > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/ > gmane.science.biology.informatics.conductor
ADD REPLY

Login before adding your answer.

Traffic: 708 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6