Indeed, you run into the same problem when trying to use PrintValue in
a package (say, for debugging purposes). I just have an implementation
that uses GlobalEnv instead of BaseEnv though I'm not sure that it's
necessarily the correct choice (though it has yet to do something I
don't want).
On 4/8
Simon,
There are a couple of subtle issues here. As I wrote, PrintValue
evaluates in the base environment, so sees only base functions. It is not
clear to me that is the right place (why the base environment and not the
base namespace, for example), and one might consider evaluating in
R_Glo
Deepayan,
don't mind my last mail - one shouldn't write e-mails before the
first cup of coffee in the morning ;).. "methods" used to be excluded
from the embedded startup (AFAIR), but that's no longer the case, so
it must be something else. Sorry for the noise (I'm off to get the
coffee :P
Deepayan,
you fail to load the methods package, so you cannot use S4. Eval
"library(methods)" first then everything is fine.
Cheers,
Simon
On Apr 7, 2007, at 7:33 PM, Deepayan Sarkar wrote:
> Hi,
>
> I think this is a bug (even though I can't find documentation
> explicitly saying that it sho
Look at the definition of PrintValue:
void PrintValue(SEXP s)
{
PrintValueEnv(s, R_BaseEnv);
}
That's not going to find show from R_BaseEnv. We need to get it from the
methods namespace.
On Sat, 7 Apr 2007, Deepayan Sarkar wrote:
> Hi,
>
> I think this is a bug (even though I can't find
Hi,
I think this is a bug (even though I can't find documentation
explicitly saying that it should work). Basically, Rf_PrintValue(obj)
fails when 'obj' is an S4 object that should be printed using show()
rather than print(). From the error message I'm guessing that the need
to use show is detecte