[R] S 3 generic method consistency warning please help

Gabor Grothendieck ggrothendieck at gmail.com
Thu Jul 31 04:46:45 CEST 2008


If you look at the generic formal arguments they look like this

> args(window)
function (x, ...)


but your window method does not start with an argument called x so
its inconsistent with its generic.

On Wed, Jul 30, 2008 at 10:40 PM, stephen sefick <ssefick at gmail.com> wrote:
> I would like to include this in a package.  The S3 methods on R CMD check
> says
> * checking S3 generic/method consistency ... WARNING
> window:
>  function(x, ...)
> window.chron:
>  function(data, day1, hour1, day2, hour2, ...)
>
> See section 'Generic functions and methods' of the 'Writing R Extensions'
> manual.
>
> I have looked and can not figure it out.  This function is for convience.
> What can I do to fix this?  This is the first time I have tried this, so be
> easy, and explain it to to me and I will try and understand.  I'm tired
> maybe that's it
>
>
> window.chron <- function(data, day1,hour1,day2,hour2){
>
> window(data, start=chron(day1, hour1), end=chron(day2, hour2))
>
> }
>
> #take a one day subset of a longer series
> t1 <- chron("1/1/2006", "00:00:00")
> t2 <- chron("1/31/2006", "23:45:00")
> deltat <- times("00:15:00")
> tt <- seq(t1, t2, by = times("00:15:00"))
> t <- rnorm(2976)
> z <- zoo(t, tt)
> f <- window.chron(z, "1/20/06", "00:00:00", "1/20/06", "23:45:00")
>
> --
> Let's not spend our time and resources thinking about things that are so
> little or so large that all they really do for us is puff us up and make us
> feel like gods. We are mammals, and have not exhausted the annoying little
> problems of being mammals.
>
> -K. Mullis
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list