[rkward-devel] R CMD check fails on packages requiring rkward

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Sun Mar 11 08:45:45 UTC 2012


Hi,

On Saturday 10 March 2012, meik michalke wrote:
> is this solvable at all?

yes, but it will be somewhat difficult to do this cleanly.

One pretty reliable way of telling whether the code is really, really running 
in an rkward session is
   is.loaded("rk.do.generic.request")
So it would be possible to simply test for that condition inside rkward::q(), 
and call base::q(), if it is not met. In fact, I guess for q(), adding this 
check is really a good idea. (While at it, it might also make sense to add a 
similar check to .onAttach(), and issue a warning, when loading the package 
outside an rkward session).

It may be tempting to add this test to .rk.do.plain.call(), which would cover 
most uses of .Call() in rkward. However, I'm not sure about the performance 
implications of this (I have not done measurements).

> spontanously, the only way i can think of would be
> some sort of marker like an object value in the package namespace, to
> indicate whether the package was loaded by a starting RKWard session or
> not. it could then be checked by RKWard's q()/quit() functions.

Or simply add it as a function:
   rk.inside.rkward.session() <- is.loaded("rk.do.generic.request")

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20120311/2a590e8d/attachment.sig>


More information about the Rkward-devel mailing list