darken <- function(color, factor=1.4){
col <- col2rgb(color)
col <- col/factor
col <- rgb(t(col), maxColorValue=255)
col
}
lighten <- function(color, factor=1.4){
col <- col2rgb(color)
col <- col*factor
col <- rgb(t(col), maxColorValue=255)
col
}
makeFootnote <- function(footnoteText = format(Sys.time(), "%d %b %Y"), size = 3, color = grey(.5)) {
require(grid)
pushViewport(viewport())
grid.text(label = footnoteText ,
x = unit(1,"npc") - unit(2, "mm"),
y = unit(2, "mm"),
just = c("right", "bottom"),
gp = gpar(cex = size, col = color))
popViewport()
}