Let me suggest a different test, because slotNames was written to work
differently when given a string or a class definition. With your
definition,
R x - classRepresentation
R isS4object(x)
[1] TRUE
which I assume is not what you wanted. (Given a single string,
slotNames() tries to look up
will not give you much of a clue
without the definition of the class. Nor, for that matter, will the
ordinary dump() output, but that at least may be re-executable, once you
have the correct class definition.
In either case, you would need to get the S-language definition of the
class.
John Chambers
Bickel, David wrote:
Does anyone know how to use the equivalent of debug() on an S4 method? I would like
R to enter the browser not for the generic function, but for the method of the class
that I specify.
This is what the trace() function does, if you supply the signature=
argument set to
, not
r-help.
John Chambers
Eryk.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
John M. Chambers [EMAIL
No, not lazy evaluation. The explanation has to do with environments
and how callGeneric works.
It's an interesting (if obscure) example.
Here's the essence of it, embedded in some comments on debugging and on
style. (This will be a fairly long discussion, I'm afraid.)
A useful starting
the safer place to look for information.
It is possible, but not very likely, that access lists might be revived
if the underlying mechansim for slot access is changed.
John Chambers
Matthias Thanks, for your help Matthias
Martin
___
R
It was never the intention that validity checking happen automatically
on _every_ assignment of an object from the class--since those
assignments take place frequently during evaluation of functions, the
overhead would be unacceptable. And as Robert points out, one needs to
postpone validity
The error message says it: in R, the arguments for the generic function
[ include i and j; the method definition must include those as well.
Do getGeneric([) or ?[ to see the arguments.
As has been said on the R mailing lists in the past, R is generally
compatible with the published books,
J Swinton wrote:
Is this the expected and/or correct behaviour? And if
so, how do I persuade new to interpret a named but
missing argument as missing?
The general problem you're having has to do with understanding ...,
not with new(), but as it happens, there is a special mechanism for
calls
Thomas Stabla wrote:
Hello,
I have defined a new class
setClass(myclass, representation(min = numeric, max = numeric))
and want to write accessor functions, so that for
foo = new(myclass, min = 0, max = 1)
min(foo) # prints 0
max(foo) # prints 1
At first i created a generic
methods defined in the package for assigning the body of
special classes of functions. The version on the base package is not a
generic.
It's possible that in the future conflicts() might not report a generic
vs a non-generic version of the same function, if they were compatible.
John Chambers.
R
the software calling some
function or operator other than -, or using - in a special way
(e.g., x - validObject(x) if validity checking was the goal).
Regards,
John Chambers
Patrick Burns wrote:
I think Brian's question --- what are you trying to do? -- should
be the first order of business
.Object is exactly BECAUSE it expects
user-defined arguments, in the ..., to start with a letter, and so
chooses .Object to minimize the chance of conflicting.)
Regards,
John Chambers
Duncan Murdoch
__
[EMAIL PROTECTED] mailing list
https
ordinary arguments. Not every example will work, but many
will.
John Chambers
Marsland, John wrote:
I have been writing some S4 classes and have a problem about how I might
pass a signature to c().
Take the following example:
setClass(collection, representation(list, date=POSIXt))
x
. If there is a
strong desire, the formal arguments could be changed, to function(x,
..., na.rm = FALSE). But this needs some discussion (preferrably on
R-devel).
John Chambers
Anton
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman
Laurent Gautier wrote:
Dear List,
I am trying to override the replace method [- for
objects of class matrix... with little success...
Would anyone know where I am wrong ?
Not wrong at all. The problem is that matrix (and array) are
implicit classes in R--there is no explicit class
involve methods.)
John Chambers
luke
--
Luke Tierney
University of Iowa Phone: 319-335-3386
Department of Statistics andFax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: [EMAIL PROTECTED]
Iowa City
()
Regards,
John Chambers
Roger Peng wrote:
I'm trying to write a package which uses classes/methods as defined in the
`methods' package. I have a single .R file which defines the class and
various methods for that class. At the top of the file I have
require(methods
18 matches
Mail list logo