Dear R users,
I am learning the OOP programming with R, in particular with reference classes.

If I have a class, e.g.

myclass <- setRefClass(class="myclass", fields=list(x="numeric"));

I know that if I do not want to set any class for x, I can just type 
fields=list(x="ANY"). But what if
I want to allow x to be of two possible classes, e.g. "numeric" or "logical". 
They do not inherit from each other, so setting the one and passing the other 
class results in an error.

Any suggestions will be appreciated.

Best regards,

Martin

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to