R how at the same time save png/pdf
other image in multiple formats?
If ggplot
an object with ggsave
a line or two, if not it?
png/pdf()
Combination dev.off()
is usually stored method, but a combination can only save a picture. To save multiple images to produce images of objects many times as necessary to generate, if a simple mapping script better, copy and paste on the line, if it is a long, complex mapping script it? If the batch cycle is plotted against it?
Non- ggplot
target while drawing generation png
and pdf
so on vector graphics, this requirement is common in process development in it, so it is necessary to understand the following methods:
pdf("test.pdf")
a<-dev.cur() #记录pdf设备
png("test.png")
dev.control("enable")
plot(sin, -pi, 2*pi) #绘图
dev.copy(which=a) #复制来自png设备的图片到pdf
dev.off()
dev.off()