I am trying to add an .png image (logo) to the header of my pdf report of graphs created with ggplot and printed to pdf.
I found the following example how to add a i
here's a suggestion,
library(ggplot2)
p.example = qplot(mpg, wt, data = mtcars)
library(grid)
library(gtable)
ann <- rasterGrob(mypng, width=unit(1,"cm"), x = unit(0.5,"cm"))
g <- ggplotGrob(p.example)
g <- gtable_add_rows(g, grobHeight(ann), 0)
g <- gtable_add_grob(g, ann, t=1, l=4)
grid.newpage()
grid.draw(g)