ggstamp | R Documentation |
This function is used to stamp ggplot type plots with datetime and script name. User must provide the script name.
ggstamp(plot, script = "", file, time = Sys.time())
plot |
The plot to be stamped. |
script |
the script name. Date and time will be added automatically. |
file |
An optional output filename to be included in the stamp. |
time |
The timestamp to be included. |
The stamp is adding using the caption label. If a caption is already in the plot, the stamp will be added in a new line.
The caption is derived as caption=paste(c(plot$label$caption,stamp,paste(date.txt,file)),collapse="\n")
ggplot 2.2.1 (which is years old) or newer is required.
the plot with a stamp
A plot object with the stamp added as caption
Other Plotting:
canvasSize()
,
ggwater()
,
ggwrite()
library(ggplot2)
data(ChickWeight)
p1 <- ggplot(ChickWeight,aes(Time,weight,group=Chick,colour=factor(Diet)))+geom_line()
script <- "note"
ggstamp(p1,script)
## Or use ggwrite which will call ggstamp when the `script` argument is provided.
ggwrite(p1,script=script,canvas="wide")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.