spellLengths | R Documentation |
Function to calculate the length (duration in years) of wet or dry periods.
spellLengths(s)
s |
A binary vector of 0 dry and 1 wet only. |
Returns a list object containing a vector of dry spell lengths and a vector of wet spell lengths.
#use 0 for dry and 1 for wet years
spells = c(0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0)
spellLengths(spells)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.