#' draws an arrow head at specified coordinates
#'
#' @param x x coordinate
#' @param y y coordinate
#' @param dir one of L (left), R (right), U (up) or D (down)
#' @param size multiplier of size of the arrow
#' @param notch the proportion of the arrow which is recurrent; 0 = flat
#' @param ... further polygon parameters
arrowhead=function(x,y,dir="L",size=1,xpd=FALSE,notch=0,...){
ED=1;WD=0.5;LN=1-notch
F1=c(0,ED,LN,ED,0)*size
F2=c(0,WD,0,-WD,0)*size
XX=rep(x,5);YY=rep(y,5)
if(dir=='L'){X=XX+F1;Y=YY+F2}
if(dir=='R'){X=XX-F1;Y=YY+F2}
if(dir=='U'){X=XX-F2;Y=YY-F1}
if(dir=='D'){X=XX+F2;Y=YY+F1}
polygon(X,Y,col=col,border=border,xpd=xpd,...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.