[R] In praise of -

2004-02-17 Thread Murray Jorgensen
This is not a problem, but I thought that I might say one or two things 
in favour of right pointing assignment before anybody influential gets 
the idea of scrapping it!

Situation (a)

You have just typed a long complcated expression into the console and 
you suddenly realise that you will need it later in the session. Just 
append
- something
to the end of the expression. You can do this with any recently 
evaluated expression with the help of the up-arrow key (in Windows at 
least).

Situation (b)

You have written a chunk of code and you want to see how it behaves for 
various values of the scalar fred. Just put
- fred
at the start of the code block, type any number, then paste the code 
into the console.

Cheers,  Murray

--
Dr Murray Jorgensen  http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: [EMAIL PROTECTED]Fax 7 838 4155
Phone  +64 7 838 4773 wk+64 7 849 6486 homeMobile 021 1395 862
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] In praise of -

2004-02-17 Thread Liaw, Andy
 From: Murray Jorgensen
 
 This is not a problem, but I thought that I might say one or 
 two things 
 in favour of right pointing assignment before anybody 
 influential gets 
 the idea of scrapping it!
 
 Situation (a)
 
 You have just typed a long complcated expression into the console and 
 you suddenly realise that you will need it later in the session. Just 
 append
 - something
 to the end of the expression. You can do this with any recently 
 evaluated expression with the help of the up-arrow key (in Windows at 
 least).

You can do this just as easily in two ways:

1. IforgotThis - .Last.value   [This always works, even if command editing
is not available.]

2. If command line editing is available, hit [up-arrow], [home] (or ctrl-a)
then type IforgotThis = ...
 
 Situation (b)
 
 You have written a chunk of code and you want to see how it 
 behaves for 
 various values of the scalar fred. Just put
 - fred
 at the start of the code block, type any number, then paste the code 
 into the console.

This is also easily accomodated w/o the use of -:  Instead of 

MyValue - fred
[code that follows]

use:

fred -
MyValue
[code that follows]

Andy

 
 Cheers,  Murray
 
 -- 
 Dr Murray Jorgensen  http://www.stats.waikato.ac.nz/Staff/maj.html
 Department of Statistics, University of Waikato, Hamilton, New Zealand
 Email: [EMAIL PROTECTED]Fax 7 838 4155
 Phone  +64 7 838 4773 wk+64 7 849 6486 homeMobile 021 1395 862
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 


--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] In praise of -

2004-02-17 Thread Murray Jorgensen


Liaw, Andy wrote:

 This is also easily accomodated w/o the use of -:  Instead of

 MyValue - fred
 [code that follows]

 use:

 fred -
 MyValue
 [code that follows]

 Andy
The point is that

- fred
[code that follows]
is sitting as one piece in the clipboard. So instead of

3 paste
8 paste
etc
you need to do

fred - 3 paste
fred - 8 paste
etc
Not a big saving, but some of us are lazy!

--
Dr Murray Jorgensen  http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: [EMAIL PROTECTED]Fax 7 838 4155
Phone  +64 7 838 4773 wk+64 7 849 6486 homeMobile 021 1395 862
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html