[Vegan-commits] r538 - in pkg: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 29 11:40:11 CET 2008


Author: jarioksa
Date: 2008-10-29 11:40:10 +0100 (Wed, 29 Oct 2008)
New Revision: 538

Modified:
   pkg/R/orditkplot.R
   pkg/inst/ChangeLog
Log:
orditkplot can copy the current graph to a TIFF file

Modified: pkg/R/orditkplot.R
===================================================================
--- pkg/R/orditkplot.R	2008-10-29 08:57:36 UTC (rev 537)
+++ pkg/R/orditkplot.R	2008-10-29 10:40:10 UTC (rev 538)
@@ -230,6 +230,7 @@
                     "png" = "{PNG File} {.png}",
                     "jpg" = "{JPEG File} {.jpg .jpeg}",
                     "bmp" = "{BMP File} {.bmp}",
+                    "tiff"= "{TIFF File} {.tif .tiff}",
                     "fig" = "{XFig File} {.fig}")
         falt <- rep(TRUE, length(ftypes))
         names(falt) <- names(ftypes)
@@ -237,6 +238,10 @@
             falt["png"] <- FALSE
         if (!capabilities("jpeg"))
             falt["jpg"] <- FALSE
+        ## Should work also in R < 2.8.0 with no capabilities("tiff")
+        if (!isTRUE(unname(capabilities("tiff"))))
+            falt["tiff"] <- FALSE
+        ## bmp lives only in Windows
         if (.Platform$OS.type != "windows")
             falt["bmp"] <- FALSE
         ftypes <- ftypes[falt]
@@ -248,6 +253,8 @@
         ftype <- ftype[length(ftype)]
         if (ftype == "jpeg")
             ftype <- "jpg"
+        if (ftype == "tif")
+            ftype <- "tiff"
         mess <- "is not a supported type: file not produced. Supported types are"
         if (!(ftype %in% names(ftypes))) {
             tkmessageBox(message=paste(sQuote(ftype), mess, paste(names(ftypes),
@@ -261,7 +268,8 @@
                pdf = pdf(file=fname, width=xy$dim[1], height=xy$dim[2]),
                png = png(file=fname, width=pixdim[1], height=pixdim[2]),
                jpg = jpeg(file=fname, width=pixdim[1], height=pixdim[2],
-               quality = 100), 
+               quality = 100),
+               tiff = tiff(file=fname, width=pixdim[1], height=pixdim[2]),
                bmp = bmp(file=fname, width=pixdim[1], height=pixdim[2]),
                fig = xfig(file=fname, width=xy$dim[1], height=xy$dim[2]))
         plot.orditkplot(xy)

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2008-10-29 08:57:36 UTC (rev 537)
+++ pkg/inst/ChangeLog	2008-10-29 10:40:10 UTC (rev 538)
@@ -4,6 +4,10 @@
 
 Version 1.16-3 (opened October 27, 2008)
 
+	* orditkplot: added option to copy the current graph to a TIFF
+	file. The capabilities("tiff") check was added in R-2.8.0, but the
+	test works in R < 2.8.0 as well.
+
 	* nesteddisc: Carsten Dormann (UFZ, Leipzig, Germany) turned my
 	attention to the sensitivity of discrepancy to ties in column
 	frequencies. These are not handled by any way (yet), but the users



More information about the Vegan-commits mailing list