Re: [R] Last answer

2012-07-20 Thread arun
Hi,

Try this:

 ans<-function(){.Last.value}
 2+3
[1] 5
 ans()
[1] 5

A.K.



- Original Message -
From: darnold 
To: r-help@r-project.org
Cc: 
Sent: Friday, July 20, 2012 1:12 AM
Subject: [R] Last answer

Hi,

In Matlab, I can access the last computation as follows:

>> 2+3

ans =

     5

>> ans

ans =

     5

Anything similar in R?

David



--
View this message in context: 
http://r.789695.n4.nabble.com/Last-answer-tp4637151.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.


__
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] Last answer

2012-07-19 Thread darnold
All,

Thanks. That works.

D.



--
View this message in context: 
http://r.789695.n4.nabble.com/Last-answer-tp4637151p4637157.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] Last answer

2012-07-19 Thread Rainer Schuermann
Is that what you mean:

> 2 + 3
[1] 5
> .Last.value
[1] 5

Rgds,
Rainer

(from R-intro.pdf, page 7, 2nd footnote)


 Original-Nachricht 
> Datum: Thu, 19 Jul 2012 22:12:22 -0700 (PDT)
> Von: darnold 
> An: r-help@r-project.org
> Betreff: [R] Last answer

> Hi,
> 
> In Matlab, I can access the last computation as follows:
> 
> >> 2+3
> 
> ans =
> 
>  5
> 
> >> ans
> 
> ans =
> 
>  5
> 
> Anything similar in R?
> 
> David
> 
> 
> 
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Last-answer-tp4637151.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.

-- 
---

Gentoo Linux with KDE



-- 

---

Gentoo Linux with KDE

__
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] Last answer

2012-07-19 Thread Joshua Wiley
My apologies.  I stand corrected.  Thanks Michael.

Josh

On Thu, Jul 19, 2012 at 10:29 PM, R. Michael Weylandt
 wrote:
> See: https://stat.ethz.ch/pipermail/r-help/2012-February/303110.html
>
> Michael
>
> On Fri, Jul 20, 2012 at 12:19 AM, Joshua Wiley  wrote:
>> Hi David,
>>
>> No, but you can store the results and access that.
>>
>> ## parentheses to force printing
>> (x <- 2 + 3)
>>
>> x
>>
>> Cheers,
>>
>> Josh
>>
>>
>> On Thu, Jul 19, 2012 at 10:12 PM, darnold  wrote:
>>> Hi,
>>>
>>> In Matlab, I can access the last computation as follows:
>>>
> 2+3
>>>
>>> ans =
>>>
>>>  5
>>>
> ans
>>>
>>> ans =
>>>
>>>  5
>>>
>>> Anything similar in R?
>>>
>>> David
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://r.789695.n4.nabble.com/Last-answer-tp4637151.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.
>>
>>
>>
>> --
>> Joshua Wiley
>> Ph.D. Student, Health Psychology
>> Programmer Analyst II, Statistical Consulting Group
>> University of California, Los Angeles
>> https://joshuawiley.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.



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.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] Last answer

2012-07-19 Thread R. Michael Weylandt
See: https://stat.ethz.ch/pipermail/r-help/2012-February/303110.html

Michael

On Fri, Jul 20, 2012 at 12:19 AM, Joshua Wiley  wrote:
> Hi David,
>
> No, but you can store the results and access that.
>
> ## parentheses to force printing
> (x <- 2 + 3)
>
> x
>
> Cheers,
>
> Josh
>
>
> On Thu, Jul 19, 2012 at 10:12 PM, darnold  wrote:
>> Hi,
>>
>> In Matlab, I can access the last computation as follows:
>>
 2+3
>>
>> ans =
>>
>>  5
>>
 ans
>>
>> ans =
>>
>>  5
>>
>> Anything similar in R?
>>
>> David
>>
>>
>>
>> --
>> View this message in context: 
>> http://r.789695.n4.nabble.com/Last-answer-tp4637151.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.
>
>
>
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, Statistical Consulting Group
> University of California, Los Angeles
> https://joshuawiley.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.

__
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] Last answer

2012-07-19 Thread Joshua Wiley
Hi David,

No, but you can store the results and access that.

## parentheses to force printing
(x <- 2 + 3)

x

Cheers,

Josh


On Thu, Jul 19, 2012 at 10:12 PM, darnold  wrote:
> Hi,
>
> In Matlab, I can access the last computation as follows:
>
>>> 2+3
>
> ans =
>
>  5
>
>>> ans
>
> ans =
>
>  5
>
> Anything similar in R?
>
> David
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Last-answer-tp4637151.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.



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.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.


[R] Last answer

2012-07-19 Thread darnold
Hi,

In Matlab, I can access the last computation as follows:

>> 2+3

ans =

 5

>> ans

ans =

 5

Anything similar in R?

David



--
View this message in context: 
http://r.789695.n4.nabble.com/Last-answer-tp4637151.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.