I have been building a package around a sequence of S4 classes which I have coded in separate *.R files in the "./R" subdirectory of the package. The package builds without error, but when I load it in R I get: Error in reconcilePropertiesAndPrototype(name, slots, prototype, superClasses) : Class "xxxx" extends an undefined class ("yyyyyy" I guess R is trying to source the *.R files in the wrong order? Since both classes are defined in the package and work fine at the command prompt. Is it just that this has not been an issue before owing to R's lazy evaluation? Is there anything I can do about this... maybe by putting something in the "./install.R"? Regards, John Marsland using: R v1.7.1 on Windows NT 4 ********************************************************************** This is a commercial communication from Commerzbank AG.\ \ T...{{dropped}}
On Wed, 30 Jul 2003, Marsland, John wrote:> I have been building a package around a sequence of S4 classes which I have > coded in separate *.R files in the "./R" subdirectory of the package. > The package builds without error, but when I load it in R I get:[Incidentally, packages with R syntax errors `build without errors': that is not a useful test.]> Error in reconcilePropertiesAndPrototype(name, slots, prototype, > superClasses) : > Class "xxxx" extends an undefined class ("yyyyyy" > > I guess R is trying to source the *.R files in the wrong order? Since bothOr perhaps you didn't give them names in the right order? The files are not in fact source-d, but they are concatenated in alphabetical order and the concatenated file is parsed and evaluated (at load time unless you used --save: see below). `alphabetical order' is potentially locale-dependent, although we try to ensure that the C locale is used, I don't think this is bound to work on Windows.> classes are defined in the package and work fine at the command prompt. > Is it just that this has not been an issue before owing to R's lazy > evaluation? > Is there anything I can do about this... maybe by putting something in the > "./install.R"?How are you building the package? Are you using --save? If not, that is probably the solution as it is highly recommended for packages using S4 classes. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
I can only find the option "--save" under install. I'm using "Rcmd build --binary pkgName" on a Windows NT platform is there anyway I can pass a similar directive? Is there any more detailed documentation for Rcmd beyond the "Writing R Extensions" manual or should I look at the R source code? Thanks, John Marsland> -----Original Message----- > From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] > Sent: 30 July 2003 13:00 > To: Marsland, John > Cc: 'r-help at lists.R-project.org' > Subject: Re: [R] building packages using S4 methods > > > On Wed, 30 Jul 2003, Marsland, John wrote: > > > I have been building a package around a sequence of S4 > classes which I have > > coded in separate *.R files in the "./R" subdirectory of > the package. > > The package builds without error, but when I load it in R I get: > > [Incidentally, packages with R syntax errors `build without > errors': that > is not a useful test.] > > > Error in reconcilePropertiesAndPrototype(name, slots, prototype, > > superClasses) : > > Class "xxxx" extends an undefined class ("yyyyyy" > > > > I guess R is trying to source the *.R files in the wrong > order? Since both > > Or perhaps you didn't give them names in the right order? > The files are > not in fact source-d, but they are concatenated in > alphabetical order and > the concatenated file is parsed and evaluated (at load time > unless you > used --save: see below). > > `alphabetical order' is potentially locale-dependent, > although we try to > ensure that the C locale is used, I don't think this is bound > to work on > Windows. > > > classes are defined in the package and work fine at the > command prompt. > > Is it just that this has not been an issue before owing to R's lazy > > evaluation? > > Is there anything I can do about this... maybe by putting > something in the > > "./install.R"? > > How are you building the package? Are you using --save? If > not, that is > probably the solution as it is highly recommended for > packages using S4 > classes. > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UK Fax: +44 1865 272595 >********************************************************************** This is a commercial communication from Commerzbank AG.\ \ T...{{dropped}}