Re: [Rd] S4 extends a class, but .Data slot has different class

2005-04-18 Thread John Chambers
[EMAIL PROTECTED] wrote: When I define an S4 class ("B" in the example below) that directly extends another ("A" in the example below) , which in turn directly extends another ("character" in the example below), I find that the slot does not have the class I specified in setClass(), it has the unde

Re: [Rd] S4 methods semantics questions

2005-03-25 Thread John Chambers
Byron Ellis wrote: Some quick questions about S4 methods. Does the typing of S4 methods mean that lazy evaluation is no longer possible? It seems that you would need to evaluate the arguments to determine their type at dispatch. Yes, it would be a neat trick to know the class of an actual argumen

Re: [Rd] Undocumented S4 methods: generic coerce and siglist matrix, Massvector

2005-02-10 Thread John Chambers
Witold Eryk Wolski wrote: Hi, While checking the package I am getting all the time the following complain about the function: Undocumented S4 methods: generic coerce and siglist matrix,Massvector I have not defined the function nowhere in the R files. My gues is that this has something to do wi

Re: [Rd] S4 packages and .Rdata file.

2005-01-31 Thread John Chambers
Witold Eryk Wolski wrote: Dear developers. Have spend just 1 h searching for a bug in a new version of a new version of a package. I was getting a segfault all the time. "Funny" thing - there was no error neither in the S nor in the C code. To solve the problem I had to delete the .Rdata file!

Re: [Rd] RE: [R] as.character methods

2005-01-14 Thread John Chambers
McGehee, Robert wrote: Thank you for your replies. I greatly appreciate the wealth of documentation on this subject and the time spent by the John Chambers and the R Core Team making object-orient programming in R a reality. I hope to be able to give code (not just bug reports) back to the R

Re: [Rd] RE: [R] as.character methods

2005-01-14 Thread John Chambers
if (is.primitive(baseDef)) { value <- genericForPrimitive(f) and it seems John Chambers has defined an S4 generic for as.character with one arg, "x". Had he not done so it would have been (x, ...). My guess is that this is because in S the arg list is (x) and he ov

Re: [Rd] new("call") problem (PR#7490)

2005-01-10 Thread John Chambers
Too bad you didn't stick to your earlier intention: > I'll leave it up to the developers to designate this as a bug or not, > but I would certainly prefer that new() and show() never reports errors > when an empty object is passed as an argument (of any class). I agree, assuming what you mean by "e

Re: [Rd] S4 class no longer accepts matrix in array slot under 2.0.1

2005-01-10 Thread John Chambers
Your example and your subject heading are two different things. If you meant the subject heading, that in fact works. R> setClass("a1", representation(x="array")) [1] "a1" R> new("a1", x=matrix(1:12,3,4)) An object of class "a1" Slot "x": [,1] [,2] [,3] [,4] [1,]147 10 [2,]

Re: [Rd] RE: [R] Testing for S4 objects

2004-12-11 Thread John Chambers
John Fox wrote: Dear r-devel list members, I'm moving this question to r-devel because it seems thornier than I originally thought. Yes, it's certainly not for r-help. I've already mentioned (on r-help) that the approach that John Chambers suggested (below) fails for objects of

Re: [Rd] (PR#7320) Internal function isUME() in findGeneric() is wrong

2004-10-29 Thread John Chambers
Jeffrey J. Hallman wrote: OK, I looked at the documentation and you're right about that. However, I'm curious about why the first argument to UseMethod is ever necessary. Is there ever a good reason for it to be something other than the name of the calling function? (Wouldn't that lead to confusi

[Rd] Re: [R] setClassUnion

2004-10-14 Thread John Chambers
[EMAIL PROTECTED] wrote: > > Hello, > > I have a question concerning "setClassUnion". It's not really about setClassUnion, but a bug in handling slots in prototypes whose class extends a locally defined class (a class union is an example, but others would fail the same way). > I'm working with

Re: [Rd] Function _coerce_ in _setIs_ never entered (S4).

2004-10-11 Thread John Chambers
The source of the problem is that, because "list" is a basic class, there is a pre-defined method for as(x, "list") (roughly, use as.list(x)). (Technically, this is found as a method for the coerce() function.) Normally, setIs() doesn't explicitly set the method for coerce(), delaying that until

Re: [Rd] Problem with _new_ if class "lm" in object representatio n.

2004-10-01 Thread John Chambers
Eric Lecoutre wrote: > > Hi, > > For your lm problem, you could begin to create a virtual class that accepts > either NULL or a lm object: > > > setClassUnion("mylm", c("NULL","lm")) > > setClass("foo", representation(x="numeric", y="mylm")) > > new("foo",x=1,y=NULL) > > Then, you have to ch

Re: [Rd] Problem with _new_ if class "lm" in object representation.

2004-09-29 Thread John Chambers
tClass("lm") > Error in setClass("lm") : "lm" has a sealed class definition and cannot > be redefined > > I understand the errror message but I can't see the difference between > class Krig and lm which are both S3 classes. (of course except

Re: [Rd] Problem with _new_ if class "lm" in object representation.

2004-09-29 Thread John Chambers
Wolski wrote: > > Hi! > Consider this code. > > setClass("Ctest" > ,representation( > test="character" > ,bla="character" > ,mod="lm" > ) > ) > > new("Ctest",test="bla") #This produces an error. >

Re: [Rd] prototype in setClass.

2004-09-15 Thread John Chambers
It works better if you give setClass the right arguments. In your second call, you omitted the representation= argument, so you need to name the prototype argument: setClass("AtomList" ,contains="List" ,prototype = prototype(content="Atom")## wou

Re: [Rd] as(object,"list") as(object,"matrix") differences?

2004-09-09 Thread John Chambers
I did say the workaround was only a candidate! Try changing the first line to: setClass("listNamed", representation(names = "character"), contains = "list") (because the automatically generated as() methods for further derived classes, e.g. your Mlist, will not copy the names unless th

Re: [Rd] as(object,"list") as(object,"matrix") differences?

2004-09-09 Thread John Chambers
cat("An object of class ", class(object), "\n", sep="") show(as(object, "list")) }) ----- (By the way, the workaround depends on the bug fix to setAs committed recently to r-devel, so if

Re: [Rd] as(object,"list") as(object,"matrix") differences?

2004-09-08 Thread John Chambers
Please re-read the previous mail to see answers to your questions, as noted below. Wolski wrote: > > Hi! > > Some follow up questions concerning the class definition of list. > > On 9/7/2004 at 11:47 AM John Chambers wrote: > >>> > >>>as(object

Re: [Rd] package methods different behaviour R1.9.1 patchedand R2.0.0

2004-09-07 Thread John Chambers
51-07-0 > > > class(tt) > [1] "myclass" > attr(,"package") > [1] ".GlobalEnv" > > as(tt,"vector") > [1] 1 2 3 4 5 6 > > summary(dd[,1]) >Min. 1st Qu. MedianMean 3rd Qu.Max. >1.001.251.50

Re: [Rd] as(object,"list") as(object,"matrix") differences?

2004-09-07 Thread John Chambers
list" Extends: "vector" The main candidates for wrapper classes are "matrix" and "array", since these do not have a fixed set of attributes (they may or may not have "dimnames"). Class "ts" is already a formal class. John Chambers Wolski w

Re: [Rd] package methods different behaviour R1.9.1 patched and R2.0.0

2004-09-07 Thread John Chambers
It's not possible to tell what you're expecting or actually seeing from this mail. We need to see your code and the results, not your interpretation of how as() is implemented. Meanwhile, here's how a simple class that extends "matrix" works in 2.0.0 With the code: setClass("mat1", representa

[Rd] classes and namespaces, continued

2004-08-29 Thread John Chambers
Some more fixes have been committed to r-devel, again with the aim of making S4 classes, including non-exported classes, work with namespaces. (This is inevitably an iterative process of finding examples where only the class name, without the relevant package/environment, is passed down.) John --

[Rd] S3 classes in S4 class definitions

2004-08-25 Thread John Chambers
One of the changes some packages are noticing from the recent modifications to methods is warnings of "undefined classes" during installation when the package extends S3 classes or uses them as slots UNLESSS they have been declared in a setOldClass() call. The green book "strongly recommends" dec

Re: [Rd] Changes to correct problems with classes in namespaces

2004-08-24 Thread John Chambers
x27;t really mean to insert an undefined class as a slot -- that a warning (not an errorr) seems desirable. (S3 classes are fine as slots, but unless setOldClass is used they can't be verified.) John > > Brian > > On Tue, 24 Aug 2004, John Chambers wrote: > > > An e

[Rd] Changes to correct problems with classes in namespaces

2004-08-24 Thread John Chambers
An extensive set of changes to the methods package has been committed today to allow non-exported classes from packages with namespaces (and some related fixes in dealing with generic functions from namespaces as well). The namespace mechanism requires packages to export any class definitions that

Re: [Rd] tracing something in a namespace (PR#7091)

2004-07-15 Thread John Chambers
[EMAIL PROTECTED] wrote: > > # Your mailer is set to "none" (default on Windows), > # hence we cannot send the bug report directly from R. > # Please copy the bug report (after finishing it) to > # your favorite email program and send it to > # > # [EMAIL PROTECTED] > # > ###

Re: [Rd] S4 group "Math", "getGroupMembers", "genericForPrimitive"

2004-06-30 Thread John Chambers
luded > in the documentation but don't work. See example code below. > > Moreover, what about 'genericForPrimitive' which is used > in 'getGeneric'. It seems that this method is not included in > the R Version 1.9.1 (also 1.9.0). See the example code o

Re: [Rd] Problem with hasArg and the ... argument (PR#7027)

2004-06-29 Thread John Chambers
Peter Dalgaard wrote: > > <..snip> > Checking... Yep, the logic in R_sysfunction() is to give the function > of frame #n: > > if (n > 0) > n = framedepth(cptr) - n; > else > n = - n; > if (n < 0 ) > errorcall(R_GlobalContext->call, "illegal frame number"); >

Re: [Rd] Segfault: .Call and classes with logical slots

2004-04-27 Thread John Chambers
dealing with existing objects (e.g., DATAPTR() pointers); in particular, so the heavy C code uses only pointers to data, not R objects. And hopefully real compiling will eventually relieve us of some of the need. John Luke Tierney wrote: > > On 27 Apr 2004, Douglas Bates wrote: > >

Re: [Rd] Segfault: .Call and classes with logical slots

2004-04-26 Thread John Chambers
I think you need to PROTECT the vector you're putting in the slot as well as the overall object. At any rate, the problem goes away for me with the revised version of dummy.c below. (Empirically, PROTECT'ing the class definition didn't seem to be needed, but experience suggests that too much prot

Re: [Rd] Re: [R] Unexpected behaviour of identical (PR#6799)

2004-04-20 Thread John Chambers
Tony Plate wrote: > > AFAIK identical() first introduced by Chambers in "Programming with > data"? On p262 he writes: > > identical: The two objects must be exactly equal in all respects; if not > identical returns FALSE > all.equal: The two objects are expected to be identical up to small > dif

Re: [Rd] S3, S4, namespace

2004-01-12 Thread John Chambers
John Chambers wrote: > > You're caught in a subtle "gotcha" with the combination of things you're > doing. We're trying to sort out some of the interactions among > namespace & methods at the moment, so there may be a nicer solution in > the future

Re: [Rd] S3, S4, namespace

2004-01-08 Thread John Chambers
function object for > function "print" > Error in print("barprint method for bar") : > S language method selection got an error when called from internal > dispatch for function "print" > > end of R bit --- >

Re: [Rd] Was: setValidity and "initialize" method conflict ? [inR-help]

2003-11-20 Thread John Chambers
John Chambers wrote: . > > > > By the way, in the validity method you should not return a call to > warning() as in your example. The validity method just returns a > character string describing the problem. Sorry, I misread the example, the "w

Re: [Rd] Was: setValidity and "initialize" method conflict ? [in R-help]

2003-11-20 Thread John Chambers
ize" Then: R> new("C2", x = 1, id = "OK") An object of class "C2" Slot "id": [1] "OK" Slot "x": numeric(0) R> try(new("C2", x = -1, id = "BAD!")) Error in validObject(.Object) : Invalid

Re: [Rd] Object saved from 1.7.1, loaded in 1.8.0

2003-11-06 Thread John Chambers
not really from earlier versions. A function, fixPre1.8(names), will be added to the patches for 1.8.1, to let users fix loaded objects, given the names of the objects. John Chambers "Heywood, Giles" wrote: > > I am having difficulty using in 1.8.0 an object created under 1.7.

Re: [Rd] initialization of S4 classes/methods

2003-10-27 Thread John Chambers
"A.J. Rossini" wrote: > > I'm seeing weird issues in methods initialization, i.e. loading > marrayClasses loads Biobase, and when explicitly done, as in > >library(Biobase) >library(marrayClasses) > > is fine, but when Biobase is loaded via a require statement in > marrayClasses' .First.

[Rd] Bug and fix in ? operator

2003-10-17 Thread John Chambers
In 1.8, the functional forms of "?" (?f(...) and method?f(...)) were not finding the generic function & therefore not reporting method documentation. Should be fixed in a version of r-patched committed today. -- John M. Chambers [EMAIL PROTECTED] Bell Labs, Lucent Technologies

Re: [Rd] Infinite recursion in getGeneric (PR#4561)

2003-10-15 Thread John Chambers
John Chambers wrote: > > [EMAIL PROTECTED] wrote: > > > > > setClass('foo') > > [1] "foo" > > > setMethod('is.logical', 'foo', function(x) TRUE) > > [1] "is.logical" > > > getGeneric('is

Re: [Rd] Infinite recursion in getGeneric (PR#4561)

2003-10-13 Thread John Chambers
Saikat DebRoy wrote: > > On Monday, Oct 13, 2003, at 16:17 US/Eastern, John Chambers wrote: > > > As a heuristic, setting methods for language-related primitives is > > dangerous (also a little strange?). > > Yes. But if it is allowed, someone will do it. It may actua

Re: [Rd] Infinite recursion in getGeneric (PR#4561)

2003-10-13 Thread John Chambers
[EMAIL PROTECTED] wrote: > > > setClass('foo') > [1] "foo" > > setMethod('is.logical', 'foo', function(x) TRUE) > [1] "is.logical" > > getGeneric('is.integer') > Error in options(x) : evaluation is nested too deeply: infinite > recursion? This is one of a number of potential problems when meth

Re: [Rd] Problem in 'methods' package (PR#4525)

2003-10-12 Thread John Chambers
David James wrote: > > Hello, > > It seems to me that Fernando may be right. The problem seems to be > in R 1.8.0 when defining generics with explicit valueClass. E.g., > > R-1.7.1: > >> setGeneric("foo", function(x) standardGeneric("foo"), valueClass="numeric") >> setMethod("foo", "n

Re: [Rd] S4 group generic Complex not working (PR#4483)

2003-10-09 Thread John Chambers
Prof Brian Ripley wrote: > > On Thu, 9 Oct 2003 [EMAIL PROTECTED] wrote: > > > The Complex group generic for S4 methods is not working: > > > > > setClass('foo', representation(z='complex')) > > [1] "foo" > > > setMethod('Complex', 'foo', function(z) callGeneric([EMAIL PROTECTED])) > > [1] "Com

Re: [Rd] does isGeneric work differently in 1.8.0 ?

2003-09-29 Thread John Chambers
Thomas Stabla wrote: > > Hello, > > the last command (isGeneric) in following R-code (attached) produces > different output, depending on wheter 1.8.0 alpha or 1.7.1 is used. > Is that to be expected ? This is a bug, but one that may be worth understanding. In order to work properly with namesp

Re: [Rd] infinite recursion during pkg installation w/ methods, setAs

2003-09-29 Thread John Chambers
The problem seems to have been fixed with a change committed this morning to the archive. Martin Maechler wrote: > > > "Roger" == Roger D Peng <[EMAIL PROTECTED]> > > on Sun, 28 Sep 2003 17:09:04 -0400 writes: > > Roger> I ran into a problem recently trying to update a > Roge

Re: [Rd] getGenerics is wrong in 1.8.0 alpha (PR#4184)

2003-09-16 Thread John Chambers
Should now be consistent. One problem was that the base namespace, unlike other namespaces, does not have a .packageName object. I left this alone for now, and special-cased the base namespace in getPackageName(). John [EMAIL PROTECTED] wrote: > > I have mentioned this several times, and it is

Re: [Rd] couldn't find function "setClass"

2003-09-16 Thread John Chambers
Kurt Hornik wrote: > > >>>>> John Chambers writes: > > > Prof Brian Ripley wrote: > >> > >> On Tue, 16 Sep 2003, John Chambers wrote: > >> > >> > Jeff Gentry wrote: > >> > > > >> > > Hello ... >

Re: [Rd] couldn't find function "setClass"

2003-09-16 Thread John Chambers
Prof Brian Ripley wrote: > > On Tue, 16 Sep 2003, John Chambers wrote: > > > Jeff Gentry wrote: > > > > > > Hello ... > > > > > > With a new checkout of R-devel (last update was 2003-09-11) we are having > > > a problem (i

Re: [Rd] couldn't find function "setClass"

2003-09-16 Thread John Chambers
Jeff Gentry wrote: > > Hello ... > > With a new checkout of R-devel (last update was 2003-09-11) we are having > a problem (it seems to be happening to all of us here on a few different > machines) where during install/check/etc when the 'save image' happens (in > packages using 'save image'): >

Re: [Rd] R-devel on Solaris 8

2003-09-09 Thread John Chambers
Jeff Gentry wrote: > > I'm having difficulty building R-devel on Solaris 8 (current version), > while trying to update from my previous version of R-devel (2003-09-02). > > When building I get this error: > --- > make[4]: Leaving directory > `/misc/homes/madman/R-devel/src/library/met

Re: [Rd] namespaces and S4 methods/classes

2003-09-08 Thread John Chambers
Ross Ihaka wrote: > > John Chambers wrote: > > The current version of the methods package now has a namespace. Packages > > using S4 methods and classes can have NAMESPACE files. New directives > > can be included in NAMESPACE files to import and export classes and > &

[Rd] setAs() and namespaces

2003-09-08 Thread John Chambers
An example sent by Ross Ihaka points out a non-obvious step needed to export the results of setAs(). The as() mechanism can't use ordinary method dispatch because the second argument is the name of a class, not an object from the class. So it uses a "helper" function, coerce(), and sets methods f

Re: [Rd] S4 Method Collisions with "[" (PR#4075)

2003-09-06 Thread John Chambers
We have a fix for this bug, which will be comitted, probably later today. Be aware until then that some methods for primitive functions may turn up missing if one package requires() another. If you must use last night's version, a workaround is to do getAllMethods(f) for the offending functions

[Rd] namespaces and S4 methods/classes

2003-09-05 Thread John Chambers
The current version of the methods package now has a namespace. Packages using S4 methods and classes can have NAMESPACE files. New directives can be included in NAMESPACE files to import and export classes and methods. Namespaces allow cleaner definition of the API for packages, and are needed f

Re: [Rd] S4 Method Collisions with "[" (PR#4075)

2003-09-05 Thread John Chambers
[EMAIL PROTECTED] wrote: > > Full_Name: Colin A. Smith > Version: 1.8.0 > OS: Mac OS X 10.2.6 > Submission from: (NULL) (216.102.90.18) > > Both Biobase and my package annaffy use S4 classes to define methods for "[". > Both packages use the save image method of installation. (See annaffy 1.0.3 i

Re: [Rd] completeSubclasses() methods bug (PR#4051)

2003-09-03 Thread John Chambers
Yes, thanks. I have a corrected version checked out. It has some other changes--as soon as I make a cleaned-up version with this fix only, I'll commit it. John [EMAIL PROTECTED] wrote: > > Full_Name: Colin A. Smith > Version: 1.8.0 > OS: Mac OS X 10.2.6 > Submission from: (NULL) (128.102.184.8

[Rd] Documentation responsibility for functions and methods

2003-09-02 Thread John Chambers
A revised version of the undoc() function in the tools package was committed to r-devel today that attempts to implement the following policy in checking for undocumented functions and methods in a package, based on discussions recently on this list and in r-core: If a package has methods for a fu

Re: [Rd] setClass question

2003-08-26 Thread John Chambers
Roger Koenker wrote: > > I would like to add a class to the SparseM package. I have a class "matrix.csr" > that describes a matrix in compressed sparse row format, now I would like a class > matrix.diag.csr that describes such objects when they happen to be diagonal. > The idea is that matrix.dia

Re: [Rd] Re: setClass question

2003-08-26 Thread John Chambers
The "undocumented methods" part of this one is easily fixed: undoc() was calling getMethods() to get the methods defined. But this gets _all_ the visible methods of the generic, hence everyone was being charged for everyone else's methods. Instead, undoc() should call the function getMethodsMetaD

Re: [Rd] Re: setClass question

2003-08-25 Thread John Chambers
Seems that methods are being attributed a bit strangely in undoc(). Here's what I get with, I think, current r-devel and SparseM. R> library(tools) R> undoc("methods") R> library(SparseM) [1] "SparseM library loaded" R> undoc("SparseM") Undocumented code objects: %x% as.matrix diag diag<- diff

Re: [Rd] efficiency and memory use of S4 data objects

2003-08-22 Thread John Chambers
> my code can handle and will substantially increase overall execution times. > (The example in my previous post was not sufficient in itself to prove > this, but more about that below.) There are other issues such as how to > document S4 methods and how to pass RCMD check, but I wou

Re: [Rd] efficiency and memory use of S4 data objects

2003-08-21 Thread John Chambers
The general question is certainly worth discussing, but I'd be surprised if your example is measuring what you think it is. The numeric computations are almost the only thing NOT radically changed between your two examples. In the first, you are applying a "primitive" set of functions ("+", "$",

[Rd] Changes to methods package

2003-08-20 Thread John Chambers
A number of changes were committed today. Mainly: 1. It should now be possible to install packages using classes and methods in a more straightforward way, and with or without saved images (saved images are still recommended for efficiency). The idea is to be able to write class & method defini

Re: [Rd] tracing nonstandardGenericFunction

2003-08-14 Thread John Chambers
Torsten Hothorn wrote: > > Hi, > > how can one trace a nonstandardGenericFunction, > especially "initialize"? An example: > > setClass("dummy", representation(a = "numeric")) > > setMethod("initialize", "dummy", > function(.Object, a = 2) { ### I want to trace this function >

Re: [Rd] s4 methods and base

2003-08-14 Thread John Chambers
Paul Gilbert wrote: > > John > > > But maintainers of software using S3 methods and classes > > might want to consider conversions or partial conversions, when and if > > they decide to revise the software. > > I'm curious about the logistics of a partial conversion. Initially I > think I will a

Re: [Rd] s4 methods and base

2003-08-14 Thread John Chambers
Paul Gilbert wrote: > .. > > There is no inheritance in the S3 sense when an object contains an > object of another class. Am I missing something? Are you using this term > loosely or is there necessarily inheritance in S4 when one object > contains another object? No, I'm n

Re: [Rd] s4 methods and base

2003-08-12 Thread John Chambers
ttributes go into slots (the slot must have some specified class, but there are ways to allow some variation in the actual type of data in the slot). S3 methods can generally stay unchanged. - classes with multiple strings can also be converted, again if they have consistent attributes. In this ca

[Rd] Revisions of the S4 classes software + ?Documentation

2003-07-24 Thread John Chambers
Some changes to the implementation of S4 classes in the methods package will be committed to the r-devel version, probably later today. They should be largely back-compatible (exception noted below) but they are fairly extensive, so this is an advance notice. The changes form the first of a two-s

Re: [Rd] Strategies for S-PLUS compatibility?

2003-07-18 Thread John Chambers
"A.J. Rossini" wrote: > > Duncan Murdoch <[EMAIL PROTECTED]> writes: > > > I'd like to give a copy of an R package to someone using S-PLUS. It > > doesn't just run as-is, it'll need changes. Has anyone written any > > general guidelines on ways to port in that direction? > > I thought the othe

Re: [Rd] Packages, generics, S3 and S4

2003-07-09 Thread John Chambers
"Heywood, Giles" wrote: > > My question has two parts. > > The first is with regard to the frame or environment in which generic > functions are defined in packages. It seems as though they are defined > (i.e. exist as objects) in frame 1, even when defined in a package. (Frame 1 is an S-Plus c

Re: [Rd] S4 method setClass prototype definition question

2003-07-02 Thread John Chambers
I think you didn't type what you meant to type (see below.) Sourcing in your class descriptions with 1.7.1, I get what you expected. > new("Annotation1") An object of class "Annotation1" Slot "x": NULL Slot "y": NULL Slot "catId": [1] -1 Slot "isResolved": [1] FALSE Slot "resolve": logical(0

Re: [Rd] Creating a vector class

2003-06-16 Thread John Chambers
(better late than never, hopefully--a few comments on this example) Duncan Murdoch wrote: > > I'm trying to create a package for working on orientation data, i.e. > data where the observations are 3D rotations. > > There are several different representations of orientations in common > use: SO(

Re: [Rd] Problem with Rcmd check and S4 methods

2003-06-14 Thread John Chambers
Duncan Murdoch wrote: > > On Fri, 13 Jun 2003 15:04:44 -0400, you wrote: > > >I think the problem is from not using a saved image. Using your tar > >file, if I untar into orientlib/, I get the same error you report. But > >after creating the install.R file: > > Thanks, that fixed it. Perhaps

Re: [Rd] Problem with Rcmd check and S4 methods

2003-06-13 Thread John Chambers
Duncan Murdoch wrote: > > On Fri, 13 Jun 2003 13:18:23 -0400, you wrote: > > >It would be nice to be able to get a dump from the R CMD check > >evaluation--maybe someone can suggest how. > > If I just cut all the preamble from the Rout file and paste it into > the console, I get the same error.

Re: [Rd] Problem with Rcmd check and S4 methods

2003-06-13 Thread John Chambers
Duncan Murdoch wrote: > > In the little orientation data package I'm working on, the very first > example fails, even though the same code works when used in a regular > session. In my experience, this usually indicates T or F has been > used instead of TRUE or FALSE, but that's not the case this

Re: Documenting classes and methods: was [Rd] Re: R-devel Digest,Vol 3, Issue 23

2003-06-13 Thread John Chambers
. John > > Regards, > > John Marsland > > PS this has been a very useful debate for those of us enthusiastically using > S4 methods. > > > -Original Message- > > From: Duncan Murdoch [mailto:[EMAIL PROTECTED] > > Sent: 12 June 2003 18:54 >

Re: [Rd] Slow ttests in R-devel

2003-06-05 Thread John Chambers
ts of features! Many thanks. The current code passes check-all here. Please let me know of any problems. I'll be away the rest of today, but back tomorrow. John John Chambers wrote: > > Jeff Gentry wrote: > > > > On Wed, 4 Jun 2003, John Chambers wrote: > >

Re: [Rd] Slow ttests in R-devel

2003-06-05 Thread John Chambers
Jeff Gentry wrote: > > On Wed, 4 Jun 2003, John Chambers wrote: > > There was a bug leading to non-caching of methods, in the r-patched code > > from a few days ago. > > A branch update would have put the changes into R-devel also. > > The problem has been pa

Re: [Rd] Slow ttests in R-devel

2003-06-05 Thread John Chambers
There was a bug leading to non-caching of methods, in the r-patched code from a few days ago. A branch update would have put the changes into R-devel also. The problem has been partly fixed in the current code committed to R-patched (and some further fixes are in the works). (Sorry, this was dis

Re: [Rd] 'methods' and environments.

2003-06-03 Thread John Chambers
Luke Tierney wrote: > > On Mon, 2 Jun 2003, John Chambers wrote: > > > Laurent Gautier wrote: > > > > > > Hi, > > > > > > I have quite some trouble with the package methods. > > > "Environments" in R are a convenient w

Re: [Rd] 'methods' and environments.

2003-06-02 Thread John Chambers
Laurent Gautier wrote: > > Hi, > > I have quite some trouble with the package methods. > "Environments" in R are a convenient way to emulate > pointers (and avoid copies of large objects, or of > large collections of objects). So far, so good, > but the package methods is becoming more (and more)

Re: [Rd] Creating a vector class

2003-05-30 Thread John Chambers
Sounds like a nice example. Just a quick comment on one question before I have to run, will try to react more later. John Duncan Murdoch wrote: > > I'm trying to create a package for working on orientation data, i.e. > data where the observations are 3D rotations. > > There are several differe

Re: [Rd] setGeneric?

2003-05-27 Thread John Chambers
iuc.edu Roger Koenker Dept. of Economics UCL, > email [EMAIL PROTECTED] Department of Economics Drayton House, > vox:217-333-4558University of Illinois 30 Gordon St, > fax:217-244-6678Champaign, IL 61820 London,WC1H 0AX

Re: [Rd] setGeneric?

2003-05-27 Thread John Chambers
Hmm. Unfortunately (perhaps) it seems to work for me, with the current R-patched and with the 0.27 version of SparseM from CRAN, I could install and also run CMD check w/o error. (This has the simpler version , setGeneric("as.matrix.csr"), which would seem to me to be what you want.) Could you t

Re: [Rd] setGeneric

2003-04-01 Thread John Chambers
I think this is a consequence of the extra context added to make methods work right with R lexical scoping, namespaces, etc. Or a subtlety in R's definition of missing()? The problem is that somehow the default expression for argument `ncol' makes that argument appear NOT to be missing. But an a

Re: [Rd] setIs?

2003-03-31 Thread John Chambers
It's a (sort of trivial) bug in isSealedMethod, called by setMethod, arising because "%*%" doesn't belong to group "Ops" (unlike "+", etc.) so the check for sealed methods only looks as the first arg. See the definition of function isSealedMethod for what's going on. It's trivial to fix directly

Re: [Rd] What does is() mean?

2003-03-17 Thread John Chambers
Roger Koenker wrote: > > Suppose you have a class, say sex, for lack of a better example, and > you are tempted, in defining the behavior of the call, > > is(x,"sex") > > to check whether certain basic features are satisfied, not to just trust the claim > that x is specified to be of cla

[Rd] Changes in checking & error messages

2003-03-17 Thread John Chambers
Some fixes have been made to check a few errors better & to report something like the correct error message in other cases. - setMethod will now refuse to set a method for a primitive function for a basic class ("[<-" for "matrix", for example). Previously the method was set but never dispatched.

Re: [Rd] class(x) <- error

2003-02-26 Thread John Chambers
The original report was correct. I fixed the problem & had sent a message to r-devel to that effect, but we may have been having delays or other problems with our mailer. Thanks again for the report, Paul. John Chambers Ross Ihaka wrote: > > Paul Gilbert wrote: > > I think

[Rd] UseMethod; all.equal; isas-tests

2003-01-21 Thread John Chambers
1. UseMethod (via usemethod in objects.c) now uses the definition of class() to dispatch, with the methods package attached (dataClass(x)) and without (attr(x, "class")). Packages using a construction of the form if(is.null(class(x))) class(x) <- data.class(x) UseMethod("foo") shou

[Rd] UseMethod change; isas-tests; all.equal

2003-01-20 Thread John Chambers
I was a little optimistic that the modified version passed _all_ the tests. When I installed the complete change, all the fullcheck tests passed except two, demos and isas-tests. There is a tiny difference in the output of the demos test, where the previous demos.Rout had what looks like an unwan

Re: [Rd] Methods package is now attached by default

2003-01-19 Thread John Chambers
he modification tomorrow am, New York time. John Kurt Hornik wrote: > > >>>>> Prof Brian D Ripley writes: > > > On Fri, 17 Jan 2003, John Chambers wrote: > >> There are two main known differences from having methods attached: > >> > >>

Re: [Rd] Methods package is now attached by default

2003-01-18 Thread John Chambers
Prof Brian D Ripley wrote: > > On Fri, 17 Jan 2003, John Chambers wrote: > > > There are two main known differences from having methods attached: > > > > - the definition of class() changes, in particular no object ever has a > > NULL class. If you have code tha

[Rd] Methods package is now attached by default

2003-01-17 Thread John Chambers
The current r-devel (aka R 1.7.0) now attaches the package "methods" by default at startup. A new option, "defaultPackages", is set to c("methods", "ctest") by default, causing the .First in package base to require those two packages at startup. There are two main known differences from having me