Description Usage Arguments Author(s) See Also Examples
Plotting wrapper function to save plots in R as "pdf", "ps", "jpeg", "png", "bmp" or "tiff".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
filename |
name of the plot to be saved with the format type suffix. |
sw |
scaling factor of weight. |
sh |
scaling factor of height. |
sres |
scaling factor of the resolution. |
plotsfkt |
list of plots to be plotted. |
ww |
width of window. |
wh |
height of window. |
pointsize |
the default pointsize of plotted text, interpreted as big points (1/72 inch) for plots to be saved. |
dev.pointsize |
pointsize of plotted text, interpreted as big points (1/72 inch) for display in R. |
paper |
needed only if filformat = "pdf" or "ps". |
quality |
needed only if filformat = "jpeg". |
units |
needed only if filformat = "jpeg", "png", "bmp" or "tiff". |
bg |
backgroundcolor. |
fileformat |
save the plot as "pdf", "ps", "jpeg", "png", "bmp" or "tiff". |
saveit |
should plot be saved. |
notinR |
should plot be not plotted in R. |
addformat |
should plot be saved additionally in another format ("pdf", "ps", "jpeg", "png", "bmp" or "tiff"). |
Bjoern Schwalb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data(homer)
plotsfkt = function(){
colpal = c("white","black","yellow","wheat3")
align(homer,colpal = colpal,main = "D'OH!",asp = 1,axes = FALSE)
}
# choose 'saveit = TRUE' for saving the plot in the specified fileformat #
# choose 'notinR = TRUE' to suppress plotting in R #
plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "jpeg")
plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "png")
plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "bmp")
plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "tiff")
plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "ps")
plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "pdf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.