R/IsDormantSeason.r

isDormantSeason <-
function (current.month, leafgrow, leaffall) 
{
    is.dormant <- as.logical()
    if (any(c(leafgrow, leaffall) == 0)) {
        is.dormant <- FALSE
    }
    else if (leafgrow > leaffall) {
        if (current.month >= leaffall && current.month < leafgrow) {
            is.dormant <- TRUE
        }
        else is.dormant <- FALSE
    }
    else if (leafgrow < leaffall) {
        if (current.month < leafgrow || current.month >= leaffall) {
            is.dormant <- TRUE
        }
        else is.dormant <- FALSE
    }
    return(is.dormant)
}
drGeorgeXenakis/fr3PGD documentation built on June 3, 2020, 6:10 a.m.