[R] grid packages since R-1.7.1

Paul Murrell p.murrell at auckland.ac.nz
Sun Dec 7 22:56:08 CET 2003


Hi


Patrick Connolly wrote:
> On Thu, 04-Dec-2003 at 11:23PM -0600, Deepayan Sarkar wrote:
> 
> |> On Thursday 04 December 2003 21:19, Patrick Connolly wrote:
> 
> [...]
> 
> |> > options(defaultPackages =  c("mva", "lattice"), keep.source.pkgs = TRUE)
> |> >
> |> > It's rather unlikely that I should specifically load grid also, but
> |> 
> 
> |> That's exactly what you need to do (i.e., load grid explicitly).
> |> This has to do with namespaces, which makes some earlier notions
> |> obsolete. lattice 'imports' grid function definitions but by itself
> |> no longer makes them available/visible to the user.
> 
> 
> I understand from that that there is functionality in grid that
> lattice doesn't normally require and so isn't in what is 'imported' to
> lattice.  Evidently, all the time I used R-1.8.0, I was not requiring
> that functionality.


No.  lattice imports grid, which only *loads* grid so that lattice gets 
to see what grid exports;  grid is not *attached* to the search path so 
grid's exports are not visible from the command line.  If your code 
directly uses grid, you should require(grid) explicitly to place grid on 
the search path.  Luke Tierney's R News article 
(http://cran.r-project.org/doc/Rnews/Rnews_2003-1.pdf)
explains the difference between loading and attaching packages.

Paul


> |> This of course doesn't explain any problems in grid.polygon after loading 
> |> grid. grid.polygon has changed in 1.8.1, but I think it is supposed to be 
> |> back-compatible. Could you provide a reproducible example ? 
> 
> My hunch was completely off course -- nothing to do with scoping.  I
> tracked it down to a deficiency in the error messages in 1.7.1 which
> proceded to go on with what it could do without complaining about what
> it couldn't do (because of no data in some cases).  1.8.1 is more
> up-front and bawks when it can't do what was asked.  I simply added an
> if statement to avoid trying to do the impossible.
> 
> Thanks for helping me clear that up.
> 
> 


-- 
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-help mailing list