[Rd] tiff(), jpeg(), and png() in R 2.7.0: problems if 'units = "in"' but default height and width

Weigand, Stephen D. Weigand.Stephen at mayo.edu
Mon Jun 16 23:16:42 CEST 2008


I love the new tiff(), jpeg(), and png() in R 2.7.0 but found
an issue that I didn't see reported.

When specifying 'units = "in"' but forgetting to change the
default height and width (so the figure is unintentionally
going to be 480 inches by 480 inches) I run into problems.

Here's the reproducible example:

tiff("a.tiff", units = "in", res = 1200,
      compression = "lzw")
hist(rnorm(10))
dev.off()

Before dev.off(), I get these warnings:

Warning messages:
1: In title(main = main, sub = sub, xlab = xlab, ylab = ylab,
   ... :
   X11 protocol error: BadAlloc (insufficient resources for
operation)
2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab,
... :
   X11 protocol error: BadDrawable (invalid Pixmap or Window
parameter)

and the dev.off() line will give me:

  *** caught segfault ***
address 48, cause 'memory not mapped'

Traceback:
  1: dev.off()

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace


My sessionInfo()

R version 2.7.0 (2008-04-22)
sparc-sun-solaris2.10

locale:
C

attached base packages:
[1] stats     graphics  grDevices utils
[5] datasets  methods   base


My capabilities()
     jpeg      png    tcltk      X11
     TRUE     TRUE     TRUE     TRUE
     aqua http/ftp  sockets   libxml
    FALSE     TRUE     TRUE     TRUE
     fifo   cledit    iconv      NLS
     TRUE     TRUE     TRUE     TRUE
  profmem    cairo
    FALSE    FALSE


Thanks,

Stephen

-- 
::::::::::::::::::::::::::::::::::
Stephen Weigand
Division of Biostatistics
Mayo Clinic Rochester, Minn., USA
Phone (507) 266-1650, fax 284-9542



More information about the R-devel mailing list