[R] help needed. Why R does not produce lattice graphics when running command 'source (file_name)'?

Косенков Кирилл Николаевич Kosenkov.Kirill at nac.spb.ru
Wed Oct 30 17:27:49 CET 2002


Hi!
I have a source file - for example 'my.R' - which uses some functions from
'lattice' library.
It looks like that:

    library(lattice)
    pr<-xtabs(W~ff$'q1'+ff$'q2',data=ff)
    pr<-pr/rowSums(pr)*100
    pr<-as.data.frame(pr)

    barchart(pr[[2]]~pr[[3]]|pr[[1]], horizontal=TRUE, as.table=TRUE,
xlab=NULL, ylab=NULL,  col="plum", box.ratio=1,
groups=as.character(round(pr[[3]])), par.strip.text=list(font=2),
panel=function(x,y,color,subscripts,groups,...)
  { panel.barchart(x=x,y=y,box.ratio=2,col=color)
  ltext(x=x+0.2,y=y,label=groups[subscripts],adj=0,cex=0.7,font=2)
  panel.abline(h=NULL,v=1:10*10,lty="dashed",col="lightgrey")
  })

When i run this source via
> source('my.R', echo=TRUE)
everything is ok
Also, everything is ok when i cut'n'paste this syntax to the R console

But when i run this source via
> source('my.R', echo=FALSE) or source('my.R')
R does not produce any lattice plots - only empty device window
'Non-lattice' plots (like simple barplots and others) produces fine in all
cases...

What i doing wrong? Why i cant have any lattice plots when i run source file
without 'echo=TRUE' option?

Please, help.
I am using R 1.6.0 on Win2k installed from prebuild binaries


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list