#' Calculate Precipitation by Day of the Year
#'
#' @param data data.frame with the date and daily precipitation projections
#'
#' @return data.frame Data frame of averaged precipitation values
#' @export
avgdaily=function(data){
library(lubridate)
data$DOY=as.factor(yday(data$Date))
avgdata=tapply(data$Precip,data$DOY,mean)
avgdata=data.frame("DOY"=c(seq(1,366)),"Precip"=avgdata)
return(avgdata)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.