R/seriesutils.R

Defines functions maxConsecutive

# Author: Jorrel Khalil S. Aunario, [email protected]
# Date :  30 April 2010
# Version 0.0.1
# Licence GPL v3


maxConsecutive <- function(nums){
	dvec <- cumsum(c(FALSE,diff(nums)!=1))	
	return(max(table(dvec)))
}

Try the genutils package in your browser

Any scripts or data that you put into this service are public.

genutils documentation built on May 31, 2017, 3:20 a.m.