wants <- c("Cairo")
has <- wants %in% rownames(installed.packages())
if(any(!has)) install.packages(wants[!has])
See also the RStudio cheat sheet: How big is your graph?
png pdf pdf pdf
2 3 4 5
pdf
5
pdf
3
pdf
4
pdf
5
pdf()
, png()
and jpeg()
are functions that open a graphics file of the corresponding type. See ?device
for more.
Cairo
Cairo()
has a dpi
option for choosing the graphics resolution in the output file. Option type
chooses the type of the graphics file.
library(Cairo)
Cairo(width=5, height=5, units="in", file="Cairo_pdf.pdf", type="pdf",
bg="white", canvas="white", dpi=120)
plot(1:10, rnorm(10))
png
2
R markdown - markdown - R code - all posts