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:
>
> "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.
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
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
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
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
6 matches
Mail list logo