Re: [R] class export in package creation / setClass / namespace?

2009-07-21 Thread L L
Thanks to both Martins, your advice solved the confusion between S3 and S4 classes for the show method. br. Leo On Tue, Jul 21, 2009 at 9:58 AM, Martin Maechler wrote: > > "MartinMo" == Martin Morgan > > on Mon, 20 Jul 2009 18:57:33 -0700 writes: > >MartinMo> L L writes: >

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread Martin Maechler
> "MartinMo" == Martin Morgan > on Mon, 20 Jul 2009 18:57:33 -0700 writes: MartinMo> L L writes: >> Ok, I could solve also the latter problem by defining show.myclass function in >> the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE >> file.

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread Martin Morgan
L L writes: > Ok, I could solve also the latter problem by defining show.myclass function in > the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE > file. Now the package passes all checks. I would have, in NAMESPACE, importFrom(methods, show) exportMethods(show) and

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread L L
Ok, I could solve also the latter problem by defining show.myclass function in the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE file. Now the package passes all checks. The information on how to exactly extend existing methods and include new methods/classes into a packag

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread L L
Thanks, the issue was solved by adding class definitions to the zzz.R file in the R code directory. However, this led to a new problem. The zzz.R now contains class definition: > setClass("myclass", contains = "list") and method definition for the new class, extending the generic 'show': > set

[R] class export in package creation / setClass / namespace?

2009-07-09 Thread L L
Dear all, I have been trying to create an R package. This has been successfull until I tried to define classes. Currently, my procedure is the following: Start R, load the function and class definition >tmp <- function (x) {x} >setClass("rpa", contains = "list", where=topenv(parent.frame())) Us