[R] First call to constructor fails (R.oo)

2008-12-10 Thread Valentin Ruano
Hi all, I'm trying to do some object-oriented programming in R using the R.oo package. Right from the start I encountered a strange (at least for me) problem. I define a new class/constructor based on the R.oo documentation. However the first attempt to create an object fails: === Code: ===

Re: [R] First call to constructor fails (R.oo)

2008-12-10 Thread Henrik Bengtsson
Hi, Any R.oo Object must accept no arguments, e.g. Object(). Thus, in your case you need to be able to support the call MyClass(). The reason is that the first time you use the class, R.oo will create a static object of the class by calling ClassName(). Typically, I would do it this way: