[R] RUnit - need advice on a good directory structure or tips...

Seth Falcon sfalcon at fhcrc.org
Mon Feb 6 18:30:08 CET 2006


On  3 Feb 2006, sskim.box at gmail.com wrote:

> I made my own RUnit testing convention, and I want to introduce this
> to one of my friends.  Before that, I'd like to review my codes.
>
> The problem that I met when I tried to polish my codes is: How can I
> get the file path in the file???
> I.e., I want to get the path to the file that I'm writing using some magic R
> functions. But I couldn't find any good magic.
> Is there any magic?

I think the best thing would be to put your code into a package and
then decide upon a convention for RUnit testing that relies upon the
known structure of the package.

I've been putting RUnit tests in inst/unitTests in some of the
packages I work on and have a makefile in that directory that can
reinstall the package and run the tests.  It isn't all that elegant,
but I don't have to do any guessing about where the code is.

HTH,

+ seth




More information about the R-help mailing list