From Roger.Bivand at nhh.no  Tue May  2 16:13:10 2006
From: Roger.Bivand at nhh.no (Roger Bivand)
Date: Tue, 2 May 2006 16:13:10 +0200 (CEST)
Subject: [Rd] Call trellis function in a function (PR#8827)
In-Reply-To: <20060502135725.BF70519B22@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.44.0605021612390.19564-100000@reclus.nhh.no>

On Tue, 2 May 2006 xiao.gang.fan1 at libertysurf.fr wrote:

This is a FAQ:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f

> Full_Name: Fan
> Version: 2.2.1
> OS: Windows
> Submission from: (NULL) (159.50.101.9)
> 
> 
> Hello,
> 
> When I call trellis function (such as histogram, densityplot, etc.) in a
> function,
> the call seems being ignored (no graphics is drawing) if some other instructions
> 
> are placed afeter that call. 
> 
> Here's an example:
> 
> y = rnorm(100*3)
> b = sample(1:3,300,replace=T)
> 
> f = function()
> {
>   densityplot(~y|b)
> }
> 
> f1 = function()
> {
>   densityplot(~y|b)
>   return(1)
> }
> 
> f1()  # this will not draw the histogram
> f()   # this will draw the histogram
> 
> Thanks in advance
> Kind regards
> --
> Fan
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



[Rd] Call trellis function in a function (PR#8827)
Roger Bivand