Re: [R] Equivalent to Matlab's Ans

2009-06-30 Thread Liaw, Andy
Something like this?

R mean(rnorm(100))
[1] -0.0095774
R .Last.value
[1] -0.0095774

Andy 

 -Original Message-
 From: r-help-boun...@r-project.org 
 [mailto:r-help-boun...@r-project.org] On Behalf Of Stephane
 Sent: Tuesday, June 30, 2009 2:07 PM
 To: r-help@r-project.org
 Subject: [R] Equivalent to Matlab's Ans
 
 Hi everyone,
 I was just wondering if there is an equivalent in R to the 
 shortcut Ans in
 MatLab whereby I can use the previous result for the current 
 command? This
 could save a lot of time when hacking in R itself, not from an editor.
 
 Thanks,
 Stephane
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
Notice:  This e-mail message, together with any attachme...{{dropped:12}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Equivalent to Matlab's Ans

2009-06-30 Thread Hans W. Borchers

There is a discussion on this topic under the heading A shorter version of
.Last.value on July 7, 2008, see for example

http://www.nabble.com/A-shorter-version-of-%22.Last.value%22--to18322831.html#a18322831

--Hans Werner


Stephane-18 wrote:
 
 Hi everyone,
 I was just wondering if there is an equivalent in R to the shortcut Ans
 in
 MatLab whereby I can use the previous result for the current command? This
 could save a lot of time when hacking in R itself, not from an editor.
 
 Thanks,
 Stephane
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/Equivalent-to-Matlab%27s-%22Ans%22-tp24276877p24278620.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Equivalent to Matlab's Ans

2009-06-30 Thread Stephane Reissfelder
Thanks a lot for all your answers

2009/6/30 Liaw, Andy andy_l...@merck.com

 Something like this?

 R mean(rnorm(100))
 [1] -0.0095774
 R .Last.value
 [1] -0.0095774

 Andy

  -Original Message-
  From: r-help-boun...@r-project.org
  [mailto:r-help-boun...@r-project.org] On Behalf Of Stephane
  Sent: Tuesday, June 30, 2009 2:07 PM
  To: r-help@r-project.org
  Subject: [R] Equivalent to Matlab's Ans
 
  Hi everyone,
  I was just wondering if there is an equivalent in R to the
  shortcut Ans in
  MatLab whereby I can use the previous result for the current
  command? This
  could save a lot of time when hacking in R itself, not from an editor.
 
  Thanks,
  Stephane
 
[[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 Notice:  This e-mail message, together with any attach...{{dropped:17}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.