[R] R package tests

ml-r-help at epigenomics.com ml-r-help at epigenomics.com
Thu Jan 15 11:04:33 CET 2009


Hi Nathan,

in addition to what others have already mentioned there is some documentation
in the Writing R Extensions Manual:
- on the supported structure of packages, indicating where test code might be added
 http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Package-subdirectories
- and the recommended standard approach to check a package
http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Checking-and-building-packages

and a wiki article on how to combine the standard check (viz R CMD check) with any of the
unit testing approaches
http://wiki.r-project.org/rwiki/doku.php?id=developers:runit&s=unit%20test

Examples for the standard approach employed by R can be found
in the R source repository
https://svn.r-project.org/R/trunk/src/library/stats/tests/

and for unit test based checking
e.g. Rmetrics
http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/?root=rmetrics

or BioConductor examples
https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/Biobase/inst/UnitTests/
where you need the access info provided here
http://wiki.fhcrc.org/bioc/DeveloperPage


Regards,

 Matthias

Nathan S. Watson-Haigh wrote:
> I was wondering if anyone could point me in the right direction for reading up on writing tests in
> R. I'm writing some functions for inclusion into a package and would like to test them to ensure
> they're doing what I expect them to do.
> 
> Are these approaches used for testing packages in CRAN?
> 
> Cheers,
> Nathan
> 
> 

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



-- 
Matthias Burger                     Project Manager/ Biostatistician
Epigenomics AG    Kleine Praesidentenstr. 1    10178 Berlin, Germany
phone:+49-30-24345-371                          fax:+49-30-24345-555
http://www.epigenomics.com           matthias.burger at epigenomics.com
--
Epigenomics AG Berlin           Amtsgericht Charlottenburg HRB 75861
Vorstand:                           Geert Nygaard (CEO/Vorsitzender)
                                            Oliver Schacht PhD (CFO)
Aufsichtsrat:   Prof. Dr. Dr. hc. Rolf Krebs (Chairman/Vorsitzender)




More information about the R-help mailing list