Re: [R] S 3 generic method consistency warning please help

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Wed, 30 Jul 2008 22:46:45 -0400

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.
>



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. Received on Thu 31 Jul 2008 - 02:49:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Jul 2008 - 03:33:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive