Re: [Rd] package slot of generic "[" and missing env@target?
--- On Thu, 21/6/12, Hin-Tak Leung wrote: > Hi, > > Since upgraded to R 2.15, I have a problem with duplicate S4 > class name no longer works (the reason for having duplicate > S4 class names is just software forks - they are largely > identical but don't have an inheritence relationship, and > will never have such). > > This is happening with "library(mypackage2)" : > > Error: package slot missing from signature for generic > ‘[’ > and classes myclass, ANY, ANY, ANY > cannot use with duplicate class names (the package may need > to be re-installed) > > I have done "debug(methods:::.pkgMethodLabel)" and found > that curiously, it is invoked for the two copies of the "[" > generic with signature "classes myclass, ANY, ANY, ANY", > ones with > packageSlot(method@target) sets to c("mypackage2", > "methods", "methods", "methods"), the other just c("", "", > "",""), instead of > c("mypackage1", "methods", "methods", "methods"). > > So in the R debugger, I modified the packageSlot() directly, > and get library(mypacakge2) to finish loading, a few times > (once in a while R craps out with some error message about > LANGSXP - I know it is probably a bad idea to modify data > structures within the debugger, so that's probably > expected). > > So my next step was simply to patch R/library/methods to > downgrade the stop() to a warning(), as well as inserting > the missing packageSlot values there and then. > > This got both packages loaded. But then, some actual use of > "[", it gives this error instead: > > Error in .methodPackageSlots(def, label, table, dupl, > isCurrent) : > trying to get slot "target" from an object of a basic > class ("environment") with no slots > > and when I downgrade this error to a warning again, > modifying (src/main/attrib.c) I got "[" dispatched to the > base class (as well as stack imbalance - the latter is > expected and "asking for it"...). > > Anyway, I am thinking: > > - doing "debug(methods:::.pkgMethodLabel)", I see two "[" of > signature "classes myclass, ANY, ANY, ANY", one comes with > packageSlot with the correct stuff and one with just 4 "", > that seems to be a bug? > > - from the warning at the beginning: > "A specification for class “myclass” in package > ‘mypackage1’ seems equivalent to one from package > ‘mypackage2’ and is not turning on duplicate class > definitions for this class" > > It would appear that there is a "correct" way of turning on > duplicate class definition, but I have not found any > documentation to that effect. > I see some discussion about class unions, and inheritances, > but in this case, neither are appropriate - the two packages > are just forks and have no union nor inheritance > relationship; but it is desirable to load both, to check for > differences and bugs. > > - I am also curious why only "[" triggers the problem, but > not "[<-" or another of the other duplicated methods. > Obviously subsetting is being treated specially, as is > mentioned a few times in R internals; but I was expecting > subassignment to be affected also, and that does not seems > to be the case. > > > Anyhow, it is an extremely useful feature to be able to load > a past version of a package simultaneously just by renaming > the package name and namespace, to check for regression and > change-in-behavior, i.e. newly added bugs; so I am hoping to > get this working again. > > TIA. > Found a small work-around - whenever I want to switch, just do detach("package:package1", unload=TRUE) library(package2, quietly=TRUE) or vice versa. A bit tedious, also documentation says detach() doesn't always work as planned. (with 'echo=FALSE' in Sweave, the resulting tex doesn't even change at all). There are also a dozen of: Warning in FUN(X[[1L]], ...) : Created a package name, ‘2012-06-22 10:58:02’, when none found whenever detach() + library() is done. Still would appreciate clarification of the missing package slot in '[' generic (and whether it is a bug) and other matters. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Have download.packages consider non-CRAN repositories
Hi Uwe and List, Thanks for your suggestions. It's a complete repository with source Packages and the PACKAGES(.gz) index file under "src/contrib/". As mentioned: explicitly calling install.packages("PACKAGE_NAME", repos="file:///Users/arbeit/Documents/clarin/Open_Science/PMR2/", type="source"); works without any problems. But configuring the repository through R_HOME/etc/repositories and obmitting the repos argument to install.packages() is what I want and what doesn't work. Ideas? > And note that is must be a complete repository, i.e. packages in subdir > "./src/contrib". A user can use install.packages(., type="source") if > you do not provide binaries in case they are expected by default. > > Uwe Ligges I knew about the type="source" argument to install.packages() but hoped there would be a way to permanently configure this as default for a source-only repository. Thanks, Ingmar Schuster -- Ingmar Schuster Natural Language Processing Group Department of Computer Science University of Leipzig Johannisgasse 26 04103 Leipzig, Germany Tel. +49 341 9732205 http://asv.informatik.uni-leipzig.de/en/staff/Ingmar_Schuster __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Vignettes are not being (re)built.
I'm adding a couple of vignettes to an existing package. When I make a change to the sweave file, and run the check command, c:\conifers\trunk>R CMD check rconifers I get the following message(s) in the 00check.log file: * checking for unstated dependencies in vignettes ... OK * checking package vignettes in 'inst/doc' ... WARNING Package vignette(s) without corresponding PDF: 'ConifersIntroVignette.rnw' 'rconifers.Rnw' * checking running R code from vignettes ... OK * checking re-building of vignette PDFs ... OK * checking PDF version of manual ... OK When the process completes, I still don't get updated vignettes in the rconifers.Rcheck/rconifers/inst/doc directory. Why? I can't find the right switch. > win.version() [1] "Windows 7 x64 (build 7601) Service Pack 1" > > R.Version() $platform [1] "x86_64-pc-mingw32" $arch [1] "x86_64" $os [1] "mingw32" $system [1] "x86_64, mingw32" $status [1] "" $major [1] "2" $minor [1] "15.0" $year [1] "2012" $month [1] "03" $day [1] "30" $`svn rev` [1] "58871" $language [1] "R" $version.string [1] "R version 2.15.0 (2012-03-30)" $nickname [1] "" > Respectfully, Jeff. Jeff Hamann, PhD PO Box 1421 Corvallis, Oregon 97339-1421 230 SW 3rd Street Suite #310 Corvallis, Oregon 97333 541-602-5438 (c) 541-754-2457 (h) jeff.hamann[at]forestinformatics[dot]com jeff.d.hamann[at]gmail[dot]com http://www.forestinformatics.com http://en.wikipedia.org/wiki/Forest_informatics To ensure that your email is processed, include a subject entry in your email. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Build fails with sysdata.rda in R dir
I had the same issue. Try: R CMD BUILD --resave-data="best" package This worked for me. The issue seems to be in the reserving functions, but I'm not sure where. HTH Alastair __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Vignettes are not being (re)built.
On 22/06/2012 23:01, Jeff Hamann wrote: I'm adding a couple of vignettes to an existing package. Incorrectly, it seems, but you told us no details. You can use R CMD build to get the PDFs (re-)built. R CMD check checks (preferably the tarball), but re-makes nothing. When I make a change to the sweave file, and run the check command, c:\conifers\trunk>R CMD check rconifers I get the following message(s) in the 00check.log file: * checking for unstated dependencies in vignettes ... OK * checking package vignettes in 'inst/doc' ... WARNING Package vignette(s) without corresponding PDF: 'ConifersIntroVignette.rnw' 'rconifers.Rnw' * checking running R code from vignettes ... OK * checking re-building of vignette PDFs ... OK * checking PDF version of manual ... OK When the process completes, I still don't get updated vignettes in the rconifers.Rcheck/rconifers/inst/doc directory. Why? I can't find the right switch. win.version() [1] "Windows 7 x64 (build 7601) Service Pack 1" R.Version() $platform [1] "x86_64-pc-mingw32" $arch [1] "x86_64" $os [1] "mingw32" $system [1] "x86_64, mingw32" $status [1] "" $major [1] "2" $minor [1] "15.0" $year [1] "2012" $month [1] "03" $day [1] "30" $`svn rev` [1] "58871" $language [1] "R" $version.string [1] "R version 2.15.0 (2012-03-30)" $nickname [1] "" Respectfully, Jeff. Jeff Hamann, PhD PO Box 1421 Corvallis, Oregon 97339-1421 230 SW 3rd Street Suite #310 Corvallis, Oregon 97333 541-602-5438 (c) 541-754-2457 (h) jeff.hamann[at]forestinformatics[dot]com jeff.d.hamann[at]gmail[dot]com http://www.forestinformatics.com http://en.wikipedia.org/wiki/Forest_informatics To ensure that your email is processed, include a subject entry in your email. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel