From maechler at stat.math.ethz.ch  Mon Mar 31 11:32:33 2008
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Mon, 31 Mar 2008 11:32:33 +0200
Subject: [Rd] tests Rin and Rout
In-Reply-To: <20080331105833.hg2cj67g6c84c8k0@icare.u-paris10.fr>
References: <47F014DB.6040000@u-paris10.fr>
	<18416.40443.244387.473214@stat.math.ethz.ch>
	<20080331105833.hg2cj67g6c84c8k0@icare.u-paris10.fr>
Message-ID: <18416.44977.144597.422309@stat.math.ethz.ch>

>>>>> "ChrG" == cgenolin  <cgenolin at u-paris10.fr>
>>>>>     on Mon, 31 Mar 2008 10:58:33 +0200 writes:

    ChrG> Martin Maechler <maechler at stat.math.ethz.ch> a ??crit?
    ChrG> :
    >>>>>>> "CG" == Christophe Genolini <cgenolin at u-paris10.fr>
    >>>>>>> on Mon, 31 Mar 2008 00:31:55 +0200 writes:
    >> 
    >> >>
    >> >> Generally I find it's good to look at examples that
    >> work.  >> For examples of packages using tests, look at
    >> source >> packages on CRAN.  Run the tests on them (using
    >> R CMD >> check), and see what gets produced.
    >> >>
    CG> Do you have the name of a package that use it ? I try
    CG> the 10 first package, and 10 other at random, but none
    CG> of them use tests...
    >> 
    >> hmm, I see 219 out 1378 CRAN packages having a 'tests'
    >> subdirectory, so it seems you have been a bit
    >> unlucky. ;-)

    ChrG> Do you imply that I say I try and I did not ?  

not at all!  I am sorry if you (or anyone) got this impression!

    ChrG> Well, lets check that :

    ChrG> P_unluck_1 <- 1-(219/1379) 
    ChrG> (P_unluck_10 <- P_unluck_1^10) [1] 0.1773933

    ChrG> So P>0.05, once can not say that I am not a liar.
    ChrG> Further investigation are needed :-)

:-)

    >> Isn't all this is explained nicely in the "Writing R
    >> Extensions" Manual?

    ChrG> NO ! There is 8 lines on it, and the structure of the
    ChrG> Rin and Rout is not given. The writing R Ext. say "the
    ChrG> Test code can be in .R or in .Rin" but I do not know
    ChrG> what "test code" is suppose to be. I try simple things
    ChrG> like some function with argument, but it does not
    ChrG> works. I try more complicated things, I did not manage
    ChrG> to find the right things to do.

Ok; so we should expand the part in the manual.

First:  '.Rin' are typically only used very rarely; so, normally
the input file is 'foo.R' and hence (well ``hence'') must be
valid R code, typically starting by 
library(<mypackage>).

    ChrG> It also say ".Rin file containing code which in turn
    ChrG> in .R", but there is also no information about the
    ChrG> what the .Rin should be. May be it is obvious for some
    ChrG> people, but not for me.

    >> Or are there sections we should expand ?

    ChrG> I do not know, if there is only few people using it,
    ChrG> may be it is not worth. I guess you have so many other
    ChrG> thinks to do...  On the other hand, if some tool are
    ChrG> to difficult to understand, it is normal that people
    ChrG> do not use them... I don't know.

    ChrG> I will work on package example that Pr Ripley point to
    ChrG> me. Then when I will have understand the way it works,
    ChrG> would you like me to add little paragraph in "Writing
    ChrG> R extention" ? I mean, not an paragraph by expert but
    ChrG> a paragraph by a regular medium level user for some
    ChrG> other regular medium level user.

That maybe very useful, thank you for the offer!
Note that the manual source is in
  https://svn.r-project.org/R/trunk/doc/manual/R-exts.texi

    >> For answering your subsequent questions, you should
    >> probably both look at an example package *and* read the
    >> 'Writing R Extensions' manual a bit more "closely".

    ChrG> Well, I try to not disturb people for little obvious
    ChrG> thinks. I can tell you I did work hard before asking,
    ChrG> specialy before asking on r-devel...

Okay, I apologize for having misjudged your efforts.

Martin



[Rd] tests Rin and Rout
Martin Maechler