On 02/06/2010 03:39 PM, Daniel Kosztyla wrote: > Hello R-Team, > > May you help me to post a 'S4-creating Package Problem'? > Thanks already now for supporting. > The problem sounds like: > > Hello R forum, > > while compiling my R-package these 'Warnings' occur: > > ... > Warnung in matchSignature(signature, fdef, where) : > in the method signature for function "plot" no definition for class: > "prediction" > Warnung in matchSignature(signature, fdef, where) : > in the method signature for function "plot" no definition for class: > "validation" > ** help > *** installing help indices > ... > > Maybe my NAMESPACE file looks wrong. Has anybody an idea how it has to > look like to solve > this problem? ( I use exportClasses(...), exportMethods(...). ) > > I have 3 classes: 'prediction', 'validation', 'nvalidation' which have a > plot function. > There's no warning for class 'nvalidation' but for the other two. > Any suggestions?
Hi Dan Files in a package are collated and then sourced. If your 'prediction' class is in prediction.R, and your plot method is in plot.R, then the files will be collated plot.R, prediction.R, and the class definition for prediction will be unknown when the plot method is defined. Use Collate: in the DESCRIPTION file, or put class (and generic) definitions in files that collate early, e.g., AllClasses.R, AllGenerics.R. Hope that helps, Martin > > Greetings. Dan > > ______________________________________________ > R-help@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. -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793 ______________________________________________ R-help@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.