[R] Bug in plotting groupedData-objects
Grathwohl,Dominik,LAUSANNE,NRC/BAS
dominik.grathwohl at rdls.nestle.com
Thu Jul 3 17:12:16 CEST 2003
Dear Experts,
May be the problem is still solved, however I tried to find the answer in
the archives:
I use:
> R.version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 1
minor 7.1
year 2003
month 06
day 16
language R
# a small program to show you the problem:
library(NLME)
n <- 300
id <- gl(n, 3, 3*n)
visit <- rep(c(1:3), n)
y <- rnorm(3*n)
weight <- data.frame(cbind(id, visit, y))
d <- groupedData(y ~ visit|id, data=weight,
labels=list(visit="Week", y="DHA", id="ID"),
units=list(visit="(weeks)", y="(%)"), order.groups=F)
plot(d) # save by hand: 1.5 MB
if(interactive()) {
win.metafile(filename="c:/tmp/mist.emf")
plot(d)
dev.off()
}
# The file mist.emf is empty, however the plot command before works.
if(interactive()) {
win.metafile(filename="c:/tmp/mist2.emf")
plot(visit,y)
dev.off()
}
# changing object, the file mist2.emf is not empty:
if(interactive()) {
jpeg(filename="c:/tmp/mist.jpg", width=600, height=600,
pointsize=12, quality=100, bg="white")
plot(d)
dev.off()
}
# changing the driver, mist.jpg is empty!
# So the problem seems to be some interaction with groupedData objects and
graphic drivers.
# Any hind is appreciated
# Regards,
# Dominik
Dominik Grathwohl
Biostatistician
Nestlé Research Center
PO Box 44, CH-1000 Lausanne 26
Phone: + 41 21 785 8034
Fax: + 41 21 785 8556
e-mail: dominik.grathwohl at rdls.nestle.com
More information about the R-help
mailing list