Bug 15370 - Sweave creates jpeg files with png extension
Sweave creates jpeg files with png extension
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: I/O
R 3.0.1
All Linux
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-29 20:24 UTC by Martin Morgan
Modified: 2013-06-29 21:20 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Morgan 2013-06-29 20:24:08 UTC
With a file

$ cat ~/tmp/jpeg.Rnw 
\SweaveOpts{pdf=FALSE, eps=FALSE, jpeg=TRUE}

<<fig=TRUE>>=
plot(1:10)
@ 

R CMD Sweave ~/tmp/jpeg.Rnw creates an image file with extension 'png', but should create a file with extension 'jpeg'. The following patch fixes this

Index: src/library/utils/R/SweaveDrivers.R
===================================================================
--- src/library/utils/R/SweaveDrivers.R	(revision 63102)
+++ src/library/utils/R/SweaveDrivers.R	(working copy)
@@ -109,7 +109,7 @@
                            width = width, height = height,
                            res = options$resolution, units = "in")
         jpeg.Swd <- function(name, width, height, options, ...)
-            grDevices::jpeg(filename = paste(chunkprefix, "png", sep = "."),
+            grDevices::jpeg(filename = paste(chunkprefix, "jpeg", sep = "."),
                             width = width, height = height,
                             res = options$resolution, units = "in")
 

This is with

$ R --version
R Under development (unstable) (2013-06-29 r63102) -- "Unsuffered Consequences"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
Comment 1 Duncan Murdoch 2013-06-29 21:20:50 UTC
THanks, will commit fix to R-devel and R-parsed shortly.