Skip to content

Two submitted packages

3 messages · Richard M. Heiberger, Paul Murrell, Deepayan Sarkar

#
From: Prof Brian Ripley
Apologies on the typo and the two-week old 2.4.0dev.

I just downloaded
   version 2.4.0 Under development (unstable) (2006-09-04 r39086)


1.
The documentation for "off" comes from ?viewport that is part of 2.4.0dev.
Package                            LibPath 
                            "grid" "C:/PROGRA~1/R/R-24~1.0DE/library" 
                           Version                           Priority 
                           "2.4.0"                             "base" 
                            Bundle                           Contains 
                                NA                                 NA 
                           Depends                            Imports 
                       "grDevices"                                 NA 
                          Suggests                              Built 
                         "lattice"                            "2.4.0" 

clip
    One of "on", "inherit", or "off", indicating whether to clip to the
    extent of this viewport, inherit the clipping region from the parent
    viewport, or turn clipping off altogether. For back-compatibility, a
    logical value of TRUE corresponds to "on" and FALSE corresponds to
    "inherit".

The above description of clip is identical to the description in
?viewport in the released 2.3.1.


I still get the same error in 2.4.0dev that did not appear in 2.3.1
and it still looks to me like this is an equally valid statement in both
versions of R.
I think something needs to be changed to make the documentation and the
program consistent.  I like the documentation, with the three options
for clipping, and hope to see the program changed to match it.


2.
... as does options(error=recover).

I was interested in the argument
    trace(..., exit=recover)
I see now that
    options(error=recover)
does exactly what I want.  That is the incantation I was looking for.
Thank you.
#
Hi
Richard M. Heiberger wrote:
That's the documentation for the (public) viewport() function, which
allows either string or logical values.  Your code is directly modifying
the (internal, private, undocumented) structure of a "viewport" object,
which only allows logical values.

There is currently no public interface for editing a viewport (this is
something that I need to address).  In the meantime, I think a
workaround for your example would be to use ...

cpv$clip <- NA

Paul

  
    
#
On 9/5/06, Richard M. Heiberger <rmh at temple.edu> wrote:
As far as I can tell, this description applies to the 'clip' argument
of the function 'viewport'. In your call

cpv$clip <- "off"

cpv is the return value of a viewport() call. The only description I
see of the return value is

Value:

     An R object of class 'viewport'.

No one is giving you any guarantees that this is a list or similar
object, let alone that it will further contain a component called
'clip' that you are allowed to modify. I don't see how the description
of a function argument you have quoted has any relevance to the use
which is giving you an error.
Which is another way of saying that the statement is equally invalid
in both versions of R. Your use is in fact invalid, and the newer
version complains about it while the older did not.
If by that you mean you want R to throw an error everytime you do
something that is not documented, that's never going to happen.
The program does exactly what the documentation says (or am I missing
something?). The three options for clipping _are_ available to you
when you create a viewport using the viewport() function.

Deepayan

[...]