Displaying 20 results from an estimated 4000 matches similar to: "S4: Bug in group method defenition ("Compare")"
2009 Nov 25
1
group generics
I have classes A and B, where B contains A. In the implementation of
the group generic for B I would like to use the corresponding group
generic for A. Is there a way to do that?
I would also appreciate any comments if what I'm trying to do seems like
the wrong approach.
Here's a stripped down example:
setClass("A",
2007 Dec 24
0
callNextMethod() with builtin group methods fails to create proper environment
Hi all,
After all these years, I am finally porting some R-2.3.1-based S4 object
code to R-2.6.1, dealing with all the S4 object system changes that came
in R-2.4.0.
I've run across what appears to be some sort of ommission in the
implementation of callNextMethod() when used with primitives having
group generic methods.
In a stock R-2.6.1 patched (happens to be running on AMD64/RHEL 4, but
2009 Aug 17
2
S4: inheritance of validity methods?
Dear Developers,
In current implementation of validity method, objects are first coerced to
superclass (slots are striped). Thus, it is not possible to write validity
method which would perform some checks on children slots.
Say, I want to check if number of slots in a class is equal to "n":
setClass("A", representation(a="numeric", n="integer"),
2006 May 09
1
YA S4 method dispatch question
I recently encountered this and was wondering if someone
could explain what happened. Basis of question involves
what the difference between the calls makes as the end
result is the same:
> identical(matrix(1:8, nrow = 1), array(1:8, c(1, 8)))
TRUE
If I run the code below as shown, I get the following:
> foo(1:8, 4)
foo (vector, numeric)
val = 4
foo (matrix, ANY)
val = 500
foo
2013 Feb 14
1
mapply error with Math (S4 group generic)
I get an error when using self-defined (not standard) functions with mapply
with S4 objects from the raster package that I develop: "Error in
as.character(sys.call(sys.parent())[[1]]) : cannot coerce type 'closure'
to vector of type 'character'". Does anyone understand why? The problem is
illustrated below. Thanks, Robert
> # First a general example that works
2017 Apr 19
0
Crash after (wrongly) applying product operator on S4 object that derives from list
I think this is a known issue with Java messing with the stack, see
e.g. http://r.789695.n4.nabble.com/Error-memory-exhausted-limit-reached-td4729708.html.
I'll fix the infinite recursion caused by the methods package.
Michael
On Wed, Apr 19, 2017 at 1:12 AM, Wolfgang Huber <wolfgang.huber at embl.de> wrote:
> Dear Hilmar
>
> Perhaps this gives an indication of why the
2007 May 01
1
Possible problem with S4 dispatch
Hi,
First a bit of disclaimer... I haven't isolated this problem into an
easy to reproduce case, and I won't be surprised if the root cause is
a fault in my code's use of name spaces or some such.
The error I'm seeing is one in which the desired method is not found.
What worries me in terms of my expectations of how to debug the
problem is that showMethods and selectMethod both
2010 Aug 26
1
Passing arguments between S4 methods fails within a function:bug? example with raster package.
Dear all,
This problem came up initially while debugging a function, but it
seems to be a more general problem of R. I hope I'm wrong, but I can't
find another explanation. Let me illustrate with the raster package.
For an object "RasterLayer" (which inherits from Raster), there is a
method xyValues defined with the signature
2011 Jun 01
1
Overloading S4 methods
Dear all,
I am experiencing some problems with S4 method overloading. I have
defined a generic for graphics:plot, using
setGeneric("plot", useAsDefault = plot)
and with
importFrom('graphics', 'plot') and
exportMethods('plot') in the NAMESPACE file of pkg A.
I then proceed to define a method for signature c('myS4class',
'missing'). This works
2009 Apr 01
0
[LLVMdev] Type operator defenition
Hello,
When I was poking arround my llvm code, I realised that given a Type
there isn't a seperate container for the type operator functions.
Am I correct?
If so, wouldn't it make more sence to provide a container to put
the objects operator function in to reduce the overhead of
going through each non operator function to find the operator
function defined for it??
The reason for this
2009 Oct 15
2
forwarded: bug (?) in cut.POSIXt with "breaks"=integer
From: Vitalie S. <vitosmail <at> rambler.ru>
Subject: Bug in cut.POSIXt
Newsgroups: gmane.comp.lang.r.general
Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago)
Hello Everyone,
Before reporting decided to post here first:
tt <- structure(c(1254238817, 1254238859, 1254238969, 1254239080), class =
c("POSIXt",
2009 Jun 11
0
S4 Package with definition of method 'names'
Dear List,
Is it possible to build a package with 'names' method for a S4-Class?
The following works if directly pasted into R:
(a simple test class with 1 attribute that is returned by invoking 'names')
#class definition
setClass("test", representation = representation(name = "character"),
prototype = prototype(name =
2017 Apr 19
2
Crash after (wrongly) applying product operator on S4 object that derives from list
Dear Hilmar
Perhaps this gives an indication of why the infinite recursion happens:
## after calling `*` on ma and a matrix:
> showMethods(classes=class(ma), includeDefs=TRUE, inherited = TRUE)
Function: * (package base)
e1="FOOCLASS", e2="matrix"
(inherited from: e1="vector", e2="structure")
(definition from function "Ops")
2004 Jun 26
1
S4 group "Math", "getGroupMembers", "genericForPrimitive"
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 'genericForPrimitive' which is used
in
2003 Oct 09
1
S4 group generic Complex not working (PR#4483)
The Complex group generic for S4 methods is not working:
> setClass('foo', representation(z='complex'))
[1] "foo"
> setMethod('Complex', 'foo', function(z) callGeneric(z@z))
[1] "Complex"
> Arg(new('foo', z=1+0i))
Error in Arg(new("foo", z = 1 + (0+0i))) :
non-numeric argument to function
>
The fix is
2006 Apr 12
1
S4 method dispatch matrixOrArray
I have some code where the primary dispatching is on
other parameters so I'd like not to have to create a
set of functions for "matrix" and another duplicate
set for "array". But the class union technique isn't
working as implemented below and I don't have my Green
book with me. How do I fix my infinite recursion problem?
2005 Jul 19
1
S4 Dispatching
Is it possible for S4 to (continue) dispatch to a class
created during dispatching? The code below doesn't work;
is this not possible or have I ommitted something?
Concept was to create a SEXP with R_AllocatePtr, give it
a class attribute, and continue dispatch. Example code
below omits multiple parameters that can be different types.
Essentially, any parameter would be converted to an
2005 Jun 20
3
How to define S4 methods for '['
Folks:
This is a question about the S4 formal class system.
Suppose I have a class, 'foo', defined by:
setClass('foo',representation(dat='matrix', id='character') )
I wish to define a '[' method for foo that will extract from the 'dat' slot.
I would have thought that the following would work, but it doesn't:
2009 May 18
1
S4 method dispatch and namespaces: why is default method selected
Hi,
I ran into the following peculiarity involving S4 method dispatch and
namespaces.
I develop a package which have a namespace and which depends on 'pixmap'
package, which itself does not have a namespace.
Now, in my package I have a class which has a slot for objects from
class "pixmap" and I
want to have a "plot" method for this new class. Not to clutter the
2009 Sep 11
1
Modify functions in base packages (needed for completion for proto objects)
Hello everyone,
I am trying to implement completion for proto objects. Proto extends
environment in a hierarchical way. Thus completion should list all the
names in all it's parent environments.
For "normal" classes defining names.class would do the job, but completion
for "environment" is hard coded in utils:::specialCompletions by means of
base::ls(). As result