Displaying 20 results from an estimated 34 matches for "classdef".
Did you mean:
classdev
2004 Jun 18
0
Problem with setValidity() or resetClass() or ... ?
...ut as I got no answer I tried to
figure out what's happening.
Well, setValidity() behaves not as I would expect (something about the
superclasses is lost,
but nothing about the subclasses, see code below)
So, I did some debugging and it seems to be caused by resetClass() which
calls completeClassDefinition() which calls ... (see the example code
and the explanations below)
Unfortunately, I couldn't really figure out which of the called methods
is doing the "wrong thing".
Would someone explain me this?
Best regards,
Matthias
##########################################
## Exa...
2003 Mar 31
1
setIs?
I've recently updated from an early February version of 1.7.0 to
Version 1.7.0 Under development (unstable) (2003-03-25)
and am now having problems with errors giving the message:
' getExtends(ClassDef) : @ must be used on an object with a formal class'
which seems to be caused by 'setIs("character","character or NULL")'
which attempts to define 'character' as an extension of the virtual
class 'character or NULL' defined in 'setClass("char...
2005 Nov 22
1
failure in `setClass' examples
...t;)) == 1}))
Warning message:
there is no automatic definition for as(object, "trackCurve") <- value when object has class "trackMultiCurve" and no 'replace' argument was supplied; replacement will be an error in: makeExtends(class1, class2, coerce, test, replace, by, classDef1 = classDef,
R> setIs("trackMultiCurve", "trackCurve",
+ test = function(obj) {ncol(slot(obj, "y")) == 1},
+ coerce = function(obj) {
+ new("trackCurve",
+ x = slot(obj, "x"),
+ y = as.nu...
2003 Jun 23
3
FW: S4 classes, creating in C
...ialise any of the slots
setClass("LUdecomposition", representation(a="matrix", pivot = "integer"),
prototype=list(pivot = NA) )
then I get the following error message in R 1.7.1 but not R 1.7.0
Error in makePrototypeFromClassDef(properties, ClassDef, immediate) :
In making the prototype for class "LUdecomposition" elements of the
prototype
failed to match the corresponding slot class: pivot (class " integer
")
Why can I no longer use the prototype to set the default values?
Laurence Ke...
2008 Mar 26
5
S4 slot with NA default
...a new object with the correct value inserted in
the slot.
I want "NA" to signify "not known".
My attempt fails because NA is not numeric:
>
setClass
("foo",representation=representation(x="numeric"),prototype=list(x=NA))
Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
where) :
in making the prototype for class "foo" elements of the prototype
failed to match the corresponding slot class: x (class ?numeric? )
>
(the real application has other slots too). I can
use "NaN", which is numeric:
>...
2004 Aug 24
1
Changes to correct problems with classes in namespaces
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 are part of the API. Unfortunately, NOT exporting
classes has never really worked.
The problem was
2012 Oct 19
2
Mac and Windows binaries of rJava broken for R-devel?
...ith the Mac and Windows binaries of
rJava (0.9-3) currently available on CRAN for R-devel (i.e. under
bin/macosx/leopard/contrib/2.16/ and bin/windows/contrib/2.16/):
> library(rJava)
> .jinit("gaggle/inst/jars/gaggleRShell.jar")
Error in .Call("R_do_new_object", ClassDef, PACKAGE = "base") :
"R_do_new_object" not available for .Call() for package "base"
The same code works fine with R-devel on Linux and the same version
of rJava, or with R-2.15 on all platforms and the same version of
rJava (Mac or Windows binaries installed from...
2004 Oct 14
2
setClassUnion
...quietly = TRUE)
}
setClassUnion("OptionalNumeric", c("numeric", "NULL"))
setClass("class1",
representation(test1 = "OptionalNumeric"),
prototype(test1 = numeric(1)))
# why does this not work?
# The error I get is:
# Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
# where) :In making the prototype for class "class1" elements of the
# prototype failed to match the corresponding slot class: test1
# (class "OptionalNumeric ")
# Sourcing this into R gives no error for me
# but instead using
prototype(test1...
2004 Oct 14
2
setClassUnion
...quietly = TRUE)
}
setClassUnion("OptionalNumeric", c("numeric", "NULL"))
setClass("class1",
representation(test1 = "OptionalNumeric"),
prototype(test1 = numeric(1)))
# why does this not work?
# The error I get is:
# Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
# where) :In making the prototype for class "class1" elements of the
# prototype failed to match the corresponding slot class: test1
# (class "OptionalNumeric ")
# Sourcing this into R gives no error for me
# but instead using
prototype(test1...
2018 Oct 26
2
Bug report for sealClass() in Core-maintained package "methods"
...t;- findClass(Class, unique = "sealing the class", where = where)
Because findClass() always returns a list (even if argument 'unique' contains a character string), this assigns a list of length 1 to variable 'where'.
This then throws an error in the subsequent line
assignClassDef(Class, classDef, where)
For this reason, the abovementioned line should instead read:
if (missing(where)) where <- findClass(Class, unique = "sealing the class", where = where)[[1]]
Thanks very much,
Adam Gower
agower at bu.edu<mailto:agower at bu.edu>
[[alternative HTML ver...
2007 Nov 13
1
slots of type "double"
Hi,
Any idea why S4 doesn't allow slots of type "double"?
> setClass("A", representation(a="double"))
Error in makePrototypeFromClassDef(properties, ClassDef, immediate, where) :
in making the prototype for class "A" elements of the prototype failed to
match the corresponding slot class: a (class ?double? )
"numeric", "integer", "character", "complex", "raw", etc... t...
2002 Dec 13
0
Problem with RMySQL 0.5-0 under RH7.3
...lz
** R
** inst
** save image
[1] TRUE
[1] "dbObjectId"
Creating a new generic function for "format" in package
RMySQL
[1] "format"
[1] "show"
Creating a new generic function for "print" in package
RMySQL
[1] "print"
Error in getProperties(ClassDef) : "slots" is not a valid slot for this object
(or was mistakenly deleted)
Execution halted
/usr/lib/R/bin/INSTALL: line 346: 24149 Broken pipe cat
"${lib}/${pkg}/R/${pkg}"
ERROR: execution of package source for 'RMySQL' failed
=============================...
2007 Jul 16
1
S4 coerce
...con)
Warning messages:
1: there is no automatic definition for as(object, "DBIConnection") <-
value when object has class "TSconnection" and no 'replace' argument was
supplied; replacement will be an error in: makeExtends(class1, class2,
coerce, test, replace, by, classDef1 = classDef,
2: methods currently exist for coercing from "TSconnection" to
"DBIConnection"; they will be replaced. in:
..removePreviousCoerce(class1, class2, where, prevIs)
# (warning may be important, but I don't understand it)
> setAs("TSconnection", &qu...
2009 May 27
2
Object-oriented programming in R
...tanding is that the object p.plot belongs to the "ggplot"
class. However, a new class definition like
> setClass("AClass", representation(mFirst = "numeric", mSecond =
> "ggplot")) ;
yields the warning
> Warning message:
> In .completeClassSlots(ClassDef, where) :
> undefined slot classes in definition of "AClass": mSecond(class
> "ggplot")
The ggplot object is also a list :
> is.list(p.plot)
> [1] TRUE
So, I guess I could identify mSecond as being a list.
However, I don't understand why "ggplot" is...
2005 May 26
3
Buidling R on Linux (Itanium) fails (PR#7897)
...for BLAS/LAPACK
Optimizations used were -O3, and the
FPICFLAGS="-fpic"
was exported.
The build failed with the following error message:
...
dumping R code in package 'methods'
Saving namespace image ...
initializing class and method definitions now ...Error in
makePrototypeFromClassDef(properties, ClassDef, immediate, where) :
in making the prototype for class "SClassExtension" elements of the
prototype failed to match the corresponding slot class: coerce (class
?character? ), test (class ?character? ), replace (class ?character? ), simple
(class ?character? ),...
2025 Jan 18
0
How setClass() may introduce a binary dependency between packages
...aceEnvSpec(rho))
name version
"SeuratObject" "4.1.3"
(gdb) call Rf_PrintValue(symbol)
.__C__CsparseMatrix
(gdb) call Rf_PrintValue(R_GlobalContext->call)
assign(mname, def, where)
(gdb) call Rf_PrintValue(R_GlobalContext->nextcontext->call)
assignClassDef(class2, classDef2, where2, TRUE)
(gdb) call Rf_PrintValue(R_GlobalContext->nextcontext->nextcontext->call)
setIs(class2, cli, extensionObject = obji, doComplete = FALSE,
where = where)
(gdb) call Rf_PrintValue(R_GlobalContext->nextcontext->nextcontext->nextcontext->call)
c...
2025 Jan 18
0
How setClass() may introduce a binary dependency between packages
...version
> "SeuratObject" "4.1.3"
> (gdb) call Rf_PrintValue(symbol)
> .__C__CsparseMatrix
> (gdb) call Rf_PrintValue(R_GlobalContext->call)
> assign(mname, def, where)
> (gdb) call Rf_PrintValue(R_GlobalContext->nextcontext->call)
> assignClassDef(class2, classDef2, where2, TRUE)
> (gdb) call Rf_PrintValue(R_GlobalContext->nextcontext->nextcontext->call)
> setIs(class2, cli, extensionObject = obji, doComplete = FALSE,
> where = where)
> (gdb) call Rf_PrintValue(R_GlobalContext->nextcontext->nextcontext->nex...
2012 Mar 07
2
SSOAP and Chemspider: Security token?
...I need to write the token in another format? Is something else wrong? I also tried to use .literal = T to no avail: "Error occurred in the HTTP request: Empty query"
Best regards,
-Michael
PS: the error message from the genSOAPClientInterface call is:
Note: Method with signature "ClassDefinition#list" chosen for function "resolve",
target signature "ExtendedClassDefinition#SchemaCollection".
"SOAPType#SchemaCollection" would also be valid
Fehler in makePrototypeFromClassDef(properties, ClassDef, immediate, where) :
'name' muss eine nicht-...
2015 Aug 21
0
RFC: deprecating some complexity in key methods package functions
...a single argument, which
gives the same result as calling 'extends' directly. The second argument to
'is' can be one of two types (a class name or a class definition), but it
seems that only one of those options is ever used in methods or in base.?
I'd like to deprecate using a classDef as the second argument as we can
now go quite fast without doing so.
?.getGeneric has an unnecessary swap of as.double for as.numeric and also
what looks like it might be a bit of vestigial debug code ( a check for
package == "" and detailed stack trace). The subsequent C code also check...
2018 Oct 27
0
Bug report for sealClass() in Core-maintained package "methods"
...unique = "sealing the class", where = where)
>
> Because findClass() always returns a list (even if argument 'unique' contains a character string), this assigns a list of length 1 to variable 'where'.
> This then throws an error in the subsequent line
> assignClassDef(Class, classDef, where)
>
> For this reason, the abovementioned line should instead read:
> if (missing(where)) where <- findClass(Class, unique = "sealing the class", where = where)[[1]]
>
> Thanks very much,
> Adam Gower
> agower at bu.edu<mailto:agower at b...