From pgilbert at bank-banque-canada.ca  Wed May 25 16:44:11 2005
From: pgilbert at bank-banque-canada.ca (Paul Gilbert)
Date: Wed May 25 16:46:00 2005
Subject: [Rd] Rout for  library/base/R-ex/Extract.data.frame.R
In-Reply-To: <17044.34928.147357.758366@stat.math.ethz.ch>
References: <C698D707214E6F4AB39AB7096C3DE5A5AB47A1@phost015.EVAFUNDS.intermedia.net>	<42944082.9000804@statistik.uni-dortmund.de>
	<17044.34928.147357.758366@stat.math.ethz.ch>
Message-ID: <42948F3B.9090106@bank-banque-canada.ca>

Martin Maechler wrote:

>>>>>>"UweL" == Uwe Ligges <ligges@statistik.uni-dortmund.de>
>>>>>>    on Wed, 25 May 2005 11:08:18 +0200 writes:
> 
> 
>     UweL> Vadim Ogranovich wrote:
>     >> Hi,
>     >> 
>     >> I am writing a light-weight data frame class and want to
>     >> borrow the test cases from the standard data frame. I
>     >> found the test cases in
>     >> library/base/R-ex/Extract.data.frame.R, but surprisingly
>     >> no corresponding .Rout files. In fact there is no *.Rout
>     >> file in the entire tarball. Not that I cann't generate
>     >> them, but I am just curious why they are not there? How
>     >> does the base package get tested?
>     >> 
>     >> Thanks, Vadim
> 
>     UweL> The base packages have their test cases in ...R/tests
>     UweL> rather than ....R/src/library/packagename
> 
> yes, and the *examples* from the help pages are just run, and
> not compared to prespecified output in *.Rout.save (sic!) files.
> In an *installed* (not the source!) version of R or an R package 
> you find the R code for all the examples from the help pages
> in <pkg>/R-ex/*.R.   
> That's the same for all R packages, not just the standard
> packages.

Vadim

I'll expand a bit on Martin's comment. It is hard to test the output of 
all examples because some examples use random numbers, and for others 
the precision may vary a bit on different platforms. I typically add 
important examples to the tests directory, set the random number 
generation, and compare results within tolerances that work on different 
platforms.

Paul Gilbert
> 
> Martin Maechler
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Rout for library/base/R-ex/Extract.data.frame.R
Paul Gilbert