[R-sig-Geo] Extending STIDF class : cannot creat an empty STIDF object

scizmeli sa.cizmeli at usherbrooke.ca
Wed Jun 19 18:55:32 CEST 2013


Hello everyone,

Greetings to the r-sig-geo community.

I would like to extend the STIDF class :
setClass("newClass1",contains="STIDF",
representation(myslot="numeric"),prototype=prototype(myslot=numeric()))
setClass("newClass2",representation(first="newClass1",second="newClass1",third="newClass1"))

But a new empty newClass1 class created with the new() function does not
pass the validObject() test:
validObject(new("newClass1"))
Error in checkSlotAssignment(object, name, value) : 
		assignment of an object of class “NULL” is not valid for slot ‘time’ in an
object of class “STIDF”; is(value, "xts") is not TRUE

Tracking down the error, I could come to :
validObject(new("STIDF"))
Error in checkSlotAssignment(object, name, value) : 
		assignment of an object of class “NULL” is not valid for slot ‘time’ in an
object of class “STI”; is(value, "xts") is not TRUE

I need to be able to pass the test validObject(new("STIDF")) because my
newClass2 should be able to contain empty newClass1 slots. For now, it is
not possible!

Is this a bug?
Servet



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Extending-STIDF-class-cannot-creat-an-empty-STIDF-object-tp7583841.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list