From noreply at r-forge.r-project.org Mon Sep 16 04:37:23 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 16 Sep 2013 04:37:23 +0200 (CEST) Subject: [Rodbcext-commits] r43 - in pkg/genutils: . R Message-ID: <20130916023723.D02451800C9@r-forge.r-project.org> Author: jaunario Date: 2013-09-16 04:37:20 +0200 (Mon, 16 Sep 2013) New Revision: 43 Added: pkg/genutils/R/seriesutils.R Modified: pkg/genutils/DESCRIPTION pkg/genutils/R/logutils.R Log: New function maxConsecutive, counts the longest series of consecutive numbers in a vector. TODO progress.bar for messaging (logutils.r). Modified: pkg/genutils/DESCRIPTION =================================================================== --- pkg/genutils/DESCRIPTION 2013-08-26 05:08:58 UTC (rev 42) +++ pkg/genutils/DESCRIPTION 2013-09-16 02:37:20 UTC (rev 43) @@ -6,6 +6,6 @@ Depends: methods Author: Jorrel Khalil S. Aunario Maintainer: -Description: [description] +Description: General Utilities (genutils) package is a collection of commonly used basic processes like cleaning, extracting, and formatting data. License: GPL (>=2) LazyLoad: yes Modified: pkg/genutils/R/logutils.R =================================================================== --- pkg/genutils/R/logutils.R 2013-08-26 05:08:58 UTC (rev 42) +++ pkg/genutils/R/logutils.R 2013-09-16 02:37:20 UTC (rev 43) @@ -20,3 +20,7 @@ } } } + +progress.bar <- function(step, width){ + #TODO +} \ No newline at end of file Added: pkg/genutils/R/seriesutils.R =================================================================== --- pkg/genutils/R/seriesutils.R (rev 0) +++ pkg/genutils/R/seriesutils.R 2013-09-16 02:37:20 UTC (rev 43) @@ -0,0 +1,10 @@ +# Author: Jorrel Khalil S. Aunario, jaunario at gmail.com +# 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))) +}