To generalize the get.month function so that it accepts a vector of
days (the original accepted a scalar), use the following function:
get.month <- function( dayofyear )
{
last.day <- c(31,59,90,120,151,181,212,243,273,304,334,365)
first.day <- c( 1,32,60, 91,121,152,182,213,244,274,305,335)
month <- unlist(lapply( dayofyear, function(x){ c(1:12)[x>=
first.day & x <= last.day] } ))
month