[Rd] Two submitted packages

Paul Murrell p.murrell at auckland.ac.nz
Wed Sep 6 02:20:51 CEST 2006


Hi


Richard M. Heiberger wrote:
> From: Prof Brian Ripley
>> There is no '2.4.1', and your R-devel is not very recent.
> 
> 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.
>> You set cpv$clip <- "off" and the internal code assumes that it is logical 
>> (as the message says).  I can't find any documentation to support your 
>> code: if there is some please report it to the maintainer of grid (Paul 
>> Murrell).
> 
> The documentation for "off" comes from ?viewport that is part of 2.4.0dev.
>> installed.packages()["grid",]
>                            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.


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


> 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.
>>  Error in grid.Call.graphics("L_setviewport", pvp, TRUE) : 
>>          LOGICAL() can only be applied to a 'logical', not a 'character'
>>  >
> 
> 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.
>>> ## Question 1.  How do I place a trace() on grid.Call.graphics to make
>>> ## it stop and give me a traceback.
>> Not sure why you want to do that, as traceback() works here.
> ... 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.
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/




More information about the R-devel mailing list