I'm trying to convert a pdf plot to a png or jpeg file. The reason is that I want to use the images for presentations and I need both formats, having exactly the same dimensions/scaling.
I tried the function im.convert() in the animation package, but the output looks really bad, in both png and jpeg.
To be able to run the following code you need the "animation" package and the ImageMagick software (http://www.imagemagick.org/script/convert.php)
library("animation")
ani.options(outdir = getwd())
pdf("bm.pdf")
plot(1:10)
dev.off()
im.convert("bm.pdf", output = "bm.jpeg")
im.convert("bm.pdf", output = "bm.png")