[R] How do I change which R Graphics Device is active?

Mark Knecht markknecht at gmail.com
Wed Jul 1 16:48:48 CEST 2009


On Wed, Jul 1, 2009 at 7:45 AM, Barry
Rowlingson<b.rowlingson at lancaster.ac.uk> wrote:
> On Wed, Jul 1, 2009 at 3:30 PM, Don MacQueen<macq at llnl.gov> wrote:
>> My version would be
>>
>>  newDev <-  function() { dev.new(); invisible( dev.cur() ) }
>>
>> I agree with Hadley that return() is redundant in this instance. Using
>> invisible() suppresses automatic printing of the returned value when it is
>> not being assigned to a variable, thus making it more like dev.new().
>
>  Hmmm. I really like using explicit return calls in my functions. It
> seems, to me, to make it clear that I intend to return a value and
> that value is going to be useful. How can others tell (without looking
> at the ample documentation, of course) that you intend your function
> to have a meaningful return value and it's not just "falling through"?
>
> As The Zen of Python puts it:
>
>  Explicit is better than implicit.
>  Readability counts.
>
> but you know, hey, whatever you want to do :)
>
> Barry
>

As a newbie and being that I have no formal or job related programming
experience I personally like having a return value as it makes me
think about what I'm doing. That's just me though.

- Mark




More information about the R-help mailing list