search for: checkslotassign

Displaying 10 results from an estimated 10 matches for "checkslotassign".

2004 May 27
3
"privileged slots"
Hi all, in the help for RClassUtils I found the expression "privileged slots" in function "checkSlotAssignment" with the explanation: /privileged slots (those that can only be set by accesor functions defined along with the class itself)/ I thought all slots of a (not private) class can be a accessed by a user via the @ Operator. Is there a way to make a single slot of a class (not the whole cl...
2009 Aug 10
1
Validity check when setting slot
Hi, I'm wondering if the following behaviour is normal: setClass('A', representation(number='numeric'), validity=function(object){ if( object at number < -1 ) return("Invalid number"); TRUE}) >[1] "A" a <- new('A') a >An object of class ?A? >Slot "number": >numeric(0) a at number <- 0 a at number <- -3 a >An
2009 Sep 15
2
S3 objects in S4 slots
...ass "list" The last line is a bit confusing here (``got class "list", should be or extend class "list"''). There's an even more confusing error message when I try to assign the slot later on: > y = new("testclass") > y at slot = a Error in checkSlotAssignment(object, name, value) : c("assignment of an object of class \"VCorpus\" is not valid for slot \"slot\" in an object of class \"testclass\"; is(value, \"list\") is not TRUE", "assignment of an object of class \"Corpus\" is not val...
2010 Jul 15
0
impute2mach GenABEL conversion problem
Hi, I've been trying to use the impute2mach function in the GenABEL library. I unfortunately cannot make a working example as when I scale down the files I no longer get an error message. The error message that I get on the full file is: Error in checkSlotAssignment(object, name, value) : assignment of an object of class "NULL" is not valid for slot "data" in an object of class "databel"; is(value, "externalptr") is not TRUE The screen out put is: impute2mach(geno = "chr22_1000G.gen",info = "chr22...
2006 May 11
1
@ accesses attributes, not just formal slots ?
...oo", representation("numeric")) [1] "foo" > (new("foo", 1:4)->a) An object of class ?foo? [1] 1 2 3 4 > names(a) <- LETTERS[1:4] > a at names [1] "A" "B" "C" "D" > a at names <- LETTERS[5:8] Error in checkSlotAssignment(object, name, value) : "names" is not a slot in class "foo" I don't know that this asymmetry will ever cause a problem, but I just wanted to note it because it appears from the help pages 'slot {methods}' and 'slotOp {base}' that the '@' oper...
2009 May 08
1
RGoogleDocs
...can only get a doc one... Here is the code I am using: >library(RGoogleDocs) >auth = getGoogleAuth("loginName", "psswrd", service="wise") >sheets.con = getGoogleDocsConnection(auth) >a <- getDocs(sheets.con) I get the following error: Error in checkSlotAssignment(object, name, value) : assignment of an object of class "NULL" is not valid for slot "access" in an object of class "GoogleSpreadsheet"; is(value, "character") is not TRUE If i change the service to "writely", I get the full listing of the...
2008 Feb 29
1
Problems initializing an extended S4 class
...ot;, x=c(0.5, 2)) start init A start validate A done validate A done init A > a An object of class ?A? Slot "x": [1] 1 2 # But subsequently creating a derived B object fails! > new("B", a, y="foo") start init B start init A start validate A start init A Error in checkSlotAssignment(object, name, value) : assignment of an object of class "logical" is not valid for slot "x" in an object of class "A"; is(value, "numeric") is not TRUE The two things I haven't quite figured out are: 1. Why is initialize invoked *twice* for A dur...
2004 Oct 06
1
R 2.0.0: namespaces, S4 classes & versioned package installation: failure to resolve correct pkg version
...rowGroup = newGrouping(), colGroup = newGrouping()) 11 : .prototype(...) 12 : newGrouping() 13 : new("Grouping") 14 : initialize(value, ...) 15 : initialize(value, ...) 16 : "@<-"(`*tmp*`, valid, value = TRUE) 17 : "slot<-"(object, name, TRUE, value) 18 : checkSlotAssignment(object, name, value) 19 : getClass(class(obj)) 20 : .requirePackage(package) 21 : .asEnvironmentPackage(package) Error in library("EpiR.algo_1.4.0") : package/namespace load failed info: class Grouping is defined in EpiR.base and used for slot rowGroup, newGrouping is a simple wr...
2010 Jul 30
0
Fw: Having problem to define a subclass, please help me
...b" "bbb" "bbb" "bbb" Slot "y1": [1] "bbb" "bbb" "bbb" "bbb" Slot "x": [1] 1 1 1 Slot "y": [1] 2 2 2 > new("b", x1=letters[1:3], x2=letters[2:4], x=rnorm(4), y=rnorm(4)) Error in checkSlotAssignment(object, name, value) : assignment of an object of class "numeric" is not valid for slot "y1" in an object of class "b"; is(value, "character") is not TRUE Here my questions are: 1. Why I am getting the prototype object in next to previous example for s...
2008 Jun 07
1
slot(obj, "nosuch") documentation question
Using slot() on object (or "@") and using a nonexistent slotname returns an error (see example code). R> setClass("foobar", representation=list(a="numeric")) [1] "foobar" R> foobar <- new("foobar", a=5) R> foobar at a [1] 5 R> foobar at b Error: no slot of name "b" for this object of class "foobar" The details