Sometimes it can be useful to add a footnote number to graphics. This package makes it easy to automatically add a time-stamp and page number to graphics. The package can also be used to add general text anywhere on any type of graphics device (base/lattice/ggplot).
library("knitr")
knitr::opts_chunk$set(fig.align="center", fig.width=6, fig.height=6)
library("pagenum")
First, set the starting page number to 1. Each call of the
pagenum()
function will add the page number to the current
graphic and automatically increment the page number counter which is
stored in options()
.
If the argument num=""
is used, then the page counter is
not automatically incremented.
Thanks for help from Paul Murrell.