Re: [R-pkg-devel] Define S4 method for generic in other package

2015-09-01 Thread Thierry Onkelinx
Hi Hadley, Thanks for the workaround. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician a

Re: [R-pkg-devel] Define S4 method for generic in other package

2015-09-01 Thread Hadley Wickham
Ah, the problem is because of roxyen2 because: * To document your code, roxygen2 needs to load it first * But it can't load it without the definition of git2r::pull So you're stuck in a bit of a vicious circle. I usually break out of this circle by temporarily patching the NAMESPACE by hand (in t

Re: [R-pkg-devel] Define S4 method for generic in other package

2015-09-01 Thread Thierry Onkelinx
Dear Hadley, I've put a reproducible example at https://github.com/ThierryO/testS4 Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Ander

Re: [R-pkg-devel] Define S4 method for generic in other package

2015-08-31 Thread Hadley Wickham
I'd recommend creating a minimal package that illustrates the problem using an existing S4 generic in a base package (e.g. stats4::AIC). That makes it easier to figure out what's gone wrong. It's unlikely to be a roxygen2 problem since the translation from @importFrom foo bar (etc) to importFrom(f

Re: [R-pkg-devel] Define S4 method for generic in other package

2015-08-28 Thread Duncan Murdoch
On 28/08/2015 4:23 AM, Thierry Onkelinx wrote: > Dear all, > > I'm trying to define a new S4 method for a generics defined in an > other package. Here is my attempt, but that isn't working. > > bar <- function(a, b) is defined as generic and S4 method in the package foo > > #' @importFrom foo ba

[R-pkg-devel] Define S4 method for generic in other package

2015-08-28 Thread Thierry Onkelinx
Dear all, I'm trying to define a new S4 method for a generics defined in an other package. Here is my attempt, but that isn't working. bar <- function(a, b) is defined as generic and S4 method in the package foo #' @importFrom foo bar #' @importMethodsFrom foo bar setMethod( f = "bar", signa