R/filter.season.r

filter.season = function( x, period, index=TRUE ) {
  if      (period=="summer") { 
    i = which( (x>150) & (x<250) )
  } else if (period=="spring") {
    i = which(  x<149 )
  } else if (period=="winter") {
    i = which(  x>251 )
  } else  {
    i = c(1:length(x))
  }
  
  if (!index) i = x[i] 
  return (i)
}
jae0/emgis documentation built on May 28, 2019, 9:58 p.m.