Skip to content
Prev 44072 / 63424 Next

R crashes when printing a named numeric vector of a specific class - Bug?

Le mardi 11 septembre 2012 ? 16:53 +0200, Basil Abou El-Komboz a ?crit :
What is your code supposed to do exactly? ;-)

You're calling print() in your class' print.bar() function, so calling
print() on such an object will call print.bar(), which calls print(),
which calls print.bar()... In a few moments the recursion will have gone
so deep that some system limit about the stack size must be reached, and
R is killed.

If you just want to print the object as a vector, you do not need to
define any function. Or, at least, call print.default() instead of the
generic print().


My two cents