[R-pkg-devel] S3 generic/method consistency NOTE

Zhian Kamvar zk@mv@r @end|ng |rom gm@||@com
Thu Feb 6 23:42:34 CET 2025


This was the correct answer, thank you!

On Thu, Feb 6, 2025 at 00:10 Ivan Krylov <ikrylov using disroot.org> wrote:

> В Wed, 5 Feb 2025 19:52:57 -0800
> Zhian Kamvar <zkamvar using gmail.com> пишет:
>
> >   Mismatches for methods registered for non-generic:
> >   is:
> >     function(object, class2)
> >   is.genind:
> >     function(x)
> >
> >   is:
> >     function(object, class2)
> >   is.genpop:
> >     function(x)
> >
> >   sample:
> >     function(x, size, replace, prob)
> >   sample.haploGen:
> >     function(x, n)
>
> Neither methods::is nor base::sample are S3 generics, so these S3
> method registrations are not needed:
>
>
> https://github.com/thibautjombart/adegenet/blob/e4874e73f0d39ebdddeca05b7eb1359fab771aaf/NAMESPACE#L50-L51
>
> https://github.com/thibautjombart/adegenet/blob/e4874e73f0d39ebdddeca05b7eb1359fab771aaf/NAMESPACE#L73
>
> In other words, calling is(new("genind", ...)) or sample(haploGen(...))
> won't dispatch to is.genind() or sample.haploGen() anyway; these
> functions are probably intended to be called by their full names.
>
> Removing these lines and re-generating NAMESPACE should help:
>
>
> https://github.com/thibautjombart/adegenet/blob/e4874e73f0d39ebdddeca05b7eb1359fab771aaf/R/basicMethods.R#L546
>
> https://github.com/thibautjombart/adegenet/blob/e4874e73f0d39ebdddeca05b7eb1359fab771aaf/R/basicMethods.R#L553
>
> https://github.com/thibautjombart/adegenet/blob/e4874e73f0d39ebdddeca05b7eb1359fab771aaf/R/haploGen.R#L529
>
> --
> Best regards,
> Ivan
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list