(This article was first published on Dan Kelley Blog/R, and kindly contributed to Rbloggers)
Continuing on the theme of solar angles, the code given below produces an analemma diagram similar to that of Lynch (2012, figure 2).

library(oce)
loc < list(lon=0.0015, lat=51.4778) # Greenwich Observatory
t < seq.POSIXt(as.POSIXct("20140101 12:00:00", tz="UTC"),
as.POSIXct("20150101 12:00:00", tz="UTC"),
by="1 d")
sa < sunAngle(t, lon=loc$lon, lat=loc$lat)
par(mar=c(3, 3, 1, 1), mgp=c(2, 0.7, 0)) # tighten margins
plot(sa$azimuth, sa$altitude, type='p', pch=20,
xlab="Azimuth", ylab="Altitude")
grid()

References
Peter Lynch, 2012. The equation of time and the analemma. Irish Math. Soc. Bulletin, 69:4756. PDF
To leave a comment for the author, please follow the link and comment on their blog: Dan Kelley Blog/R.
Rbloggers.com offers daily email updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...