Displaying 20 results from an estimated 9000 matches similar to: "Problem with _new_ if class "lm" in object representation."
2004 Sep 30
1
Problem with _new_ if class "lm" in object representatio n.
Hi,
But "any" rises some other problems well known from S3. One has "any"
for "free" in S3. You don't need S4. . But I know how "if" polluted
functions look like in S3. They are hard to understand and to
maintain. Hence I am quite happy to use S4.
Type-checking is usefull if you program with data. Also if you are on
the "C side" of the
2003 Oct 13
2
Infinite recursion in getGeneric (PR#4561)
> 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?
>
--please do not edit the information below--
Version:
platform = i686-pc-linux-gnu
arch = i686
os = linux-gnu
system =
2001 Jun 19
3
RJava lib error
Hello all!
I recently install R-1.2.3 and Omegahat SJava pkg
(formely Java pkg) 0.62 and tried running the examples
by issuing "scripts/RJava --example --gui=none" and I
got the following:
Error in dyn.load(x, as.logical(local),
as.logical(now)) :
unable to load shared library
"/usr/lib/R/library/ctest/libs/ctest.so":
ld.so.1:
2020 May 20
1
failed check in reg-tests-1b.R
Not certain this is actually a bug, so posting here.
I'm on Ubuntu 18.04.4 LTS, building R version 4.0.0. The "configure" and
"make" steps are successful, but the "make check" step fails when it
gets to this part of ./tests/reg-tests-1b.R:
?? > ## methods() gave two wrong warnings in some cases:
?? > op <- options(warn = 2)# no warning, please!
??
2010 Feb 02
1
S4 setClass / initialize misunderstanding
Hi, I recently ran into this problem. I couldn't find any mention of it in
the setClass documentation.
setClass("Foo", representation(file = "character"))
setMethod("initialize", "Foo", function(.Object, file) {
print(file)
})
setClass("Bar", contains = "Foo")
And the error:
Error in print(file) : argument "file" is
2003 Nov 19
2
Was: setValidity and "initialize" method conflict ? [in R-help]
Hello,
Thomas Stabla (statho3@web.de) has already sent this
question to R-help, Wed, 12 Nov 2003 21:21:31 +0100,
but we are not sure whether we should better post this
mail to this audience than to R-help:
---------------------------------------------------------------------
We are using S4-classes and want to force a validity check
when an object is created.
How can this be done, when an
2003 Aug 24
2
setClass question
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.diag.csr objects should behave (later in life) exactly like
matrix.csr objects, the distinction is only needed in order to
2004 Mar 16
2
Documentation on how to put classes and methods in packages with namespace?
Documentation on how to put classes and methods in packages with namespace?
How should I define my classes and methods in "dynamicGraph"???
(That is - Can some one point me to the documentation on
how to put classes and methods in packages with a namespace? )
Currently it is done by the code below.
This gives problems, when a workspace with a "dynmaicGraph" is
2010 May 06
1
Validity glitch when contains="matrix"
Sirs:
My validity function did not run when my class contains="matrix". But if I
first define the class with contains="numeric", then define it again
with contains="matrix", validity runs. Here's the session:
> f <- function(object) "BAD CLASS" # force error to
> setClass("A", contains="matrix", validity=f)
[1]
2011 Jan 28
2
help with S4 objects: trying to use a "link-glm" as a class in an object definition
Hi,
I'm trying to make a new S4 object with a slot for a "link-glm" object. R doesn't like me have a slot of class "link-glm"
> class(make.link("probit"))
[1] "link-glm"
> setClass("a",representation(item="link-glm"))
[1] "a"
Warning message:
undefined slot classes in definition of "a": item(class
2008 Apr 15
1
Pb with validObject(..., complete=TRUE)
Hi,
When called with complete=TRUE, validObject() is supposed to work in a
recursive manner. But here is a situation where it doesn't seem to be
the case.
Let's define a class with a validity method:
setClass("PosInts", representation(ii="integer"))
setValidity("PosInts",
function(object)
{
if (!all(object at ii > 0))
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"),
2015 May 13
2
Unexpected failure when calling new() with unnamed arg and
Thanks Martin for looking into this. H.
On 05/13/2015 03:57 AM, Martin Maechler wrote:
>>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>>> on Tue, 12 May 2015 15:18:42 -0700 writes:
>
>> Hi,
>
>> The man page for new() suggests that if 'a' is an object with slots
>> "slot1" and "slot2" and C is a
2006 Jan 19
2
creating objects with a slot of class formula, using new
Hi,
This works fine.
>setClass("a",representation(b="list",c="list"))
>new("a",b=list(7))
>An object of class "a"
Slot "b":
[[1]]
[1] 7
Slot "c":
list()
But, now suppose you want a slot to accept an object of class formula...
>setClass("a",representation(b="list",c="formula"))
2015 May 12
2
Unexpected failure when calling new() with unnamed arg and
Hi,
The man page for new() suggests that if 'a' is an object with slots
"slot1" and "slot2" and C is a class that extends the class of 'a',
then the 2 following calls should be equivalent:
new("C", a, ...)
new("C", slot1=a at slot1, slot2=a at slot2, ...)
This is generally the case but I just ran into a situation where it's
not.
2015 May 28
3
S4 inheritance and old class
Hey everyone,
I would like to develop a package using S4 classes.
I have to define several S4 classes that inherits from each others as
follow:
# A <- B <- C <- D
I also would like to define .DollarNames methods for these class so, if I
have understood well, I also have to define an old class as follow:
# AOld <- A <- B <- C <- D
setOldClass(Classes = "AOld")
2015 Oct 08
1
Unexpected failure when calling new() with unnamed arg and
>>>>> Joshua Wiley <jwiley.psych at gmail.com>
>>>>> on Thu, 8 Oct 2015 12:19:16 +1100 writes:
> Hi, I realize this is an old thread, but just wondering
> whether a conclusion was ever reached on this issue? I'm
> using formula(NULL) but it would be nice if default
> initialization worked for formula classes as well.
Well,
2008 Apr 09
1
coerce methods and inheritance
Hi,
It doesn't seem that the dispatching algo is finding my coerce method under
some circumstances.
Let's say I have 2 classes, A and AA and that AA is just a direct extension
of A with no additional slots:
setClass("A", representation(ii="integer"))
setClass("AA", contains="A")
I can define a method for coercing my objects to an integer
2006 Mar 06
1
validObject does not check validity of slots
The documentation for validObject suggests that slots are checked for
validity, but validObject seems only to check that the slot has
something claiming to be correct; validObject(obj) does not perform
the equivalent of validObject(obj at y) for slot y.
This is also the second problem issue reported in
http://tolstoy.newcastle.edu.au/R/devel/05/03/0151.html
Relevant documentation, an example,
2009 Jun 18
1
validObject throws non-caught error when slot doesn't exist
I have been retooling an S4 class definition to include another slot and
have found that the methods::validObject function (defined in
methods/R/SClasses.R) in R-devel throws an error that isn't caught
internally (and thus not controllable by 'test' argument) when
retrieving a non-existent slot. The offending line of code is shown below:
> validObject
function (object, test =