Re: [Rd] Canonical S4 Method signature

2005-02-11 Thread Matthias Kohl
Paul Roebuck schrieb: I have trouble finding applicable examples of S4 methods. Could someone tell me the canonical method for a function that takes either one or two arguments corresponding to dimensions? So if vector output desired, only one argument 'n' would be provided. For matrix, two would b

[Rd] is.vector(...) <-> is(..., "vector")

2004-12-30 Thread Matthias . Kohl
Hello, Is it intended that is.vector(...) and is(..., "vector") do not always give identical results? is.vector() works as documented ('is.vector' returns 'FALSE' if 'x' has any attributes except names.) Thus, A <- array(1:2, 1:2) M <- diag(2) is.vector(M) # FALSE, as documented # and is.vector

Re: [Rd] Namespaces, coercion and setAs

2004-11-27 Thread Matthias . Kohl
Hello, does adding the line \alias{coerce,numeric,matrix.diag.csr-method} to the Rd-file of your "matrix.diag.csr" class solve the mysterium? Matthias > Absolutely correct. Adding coerce to the NAMESPACE list of > exportMethods > resolves the problem. Leaves only the mildly mysterious > > U

Re: [Rd] is.vector(as.vector(x)) is FALSE

2004-10-17 Thread Matthias . Kohl
maybe, the point is that is.vector "attempts to coerce its argument into a vector", but here it fails is.matrix(as.vector(x1mat)) [1] TRUE Matthias > > The following, which was recently discussions on the rcom-l list, > is a situation where coercing x1mat to a vector using as.vector > results in

Re: [Rd] S4 methods and polymorophism

2004-09-22 Thread Matthias . Kohl
I think, it must be x instead of object? setMethod("length", signature(x="Collection"), function(x) length([EMAIL PROTECTED])) > Hi! > Have you tried ? > > setMethod("length",signature(object="Collection"),function(object){ > length([EMAIL PROTECTED])}) > °°° >

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

2004-06-26 Thread Matthias . Kohl
Hi, I found the following on Windows 2000/NT R Version 1.9.1 (2004-06-21) (also Version 1.9.0): The S4 group "Math" doesn't work as documented; i.e., "log", "log10", "gamma" and "lgamma" are included in the documentation but don't work. See example code below. Moreover, what about 'genericForPr

[Rd] Problem with setValidity() or resetClass() or ... ?

2004-06-18 Thread Matthias Kohl
Hi, I'm working with Version 1.9.0 (2004-04-12) on Windows 98/NT/2000 where I found the following wrong (?) behavior of setValidity(). I already mentioned this on the R-help list (2004-06-11, was "setValidity changes Extends?") , but as I got no answer I tried to figure out what's happening. W

Re: [Rd] request for comments --- package "distr" --- S4 Classes for Distributions

2004-02-03 Thread Matthias Kohl
Peter Dalgaard schrieb: "Warnes, Gregory R" <[EMAIL PROTECTED]> writes: as subclasses of either of the two the subclasses "AbscontDistribution" or " DiscreteDistribution". It is not at all clear to me what an 'AbscontDistribution' is. Perhaps you are referring to a continuous distrib