[R] R package tests

Philippe Grosjean phgrosjean at sciviews.org
Thu Jan 15 09:22:36 CET 2009


There is a mechanism for testing code in R packages (R CMD check), see 
the Writing R extensions manual. If you need more flexibility for your 
tests, you could look at RUnit on CRAN, or svUnit on R-Forge 
(http://r-forge.r-project.org, on CRAN soon). For the later one, you 
install it by:

install.packages("svUnit", repos="http://R-Forge.R-project.org")

These is a vignette associated with svUnit:

vignette("svUnit")

Note that RUnit and svUnit are "test suite code" compatible, but they 
use very different mechanisms internally.
Best,

Philippe Grosjean

..............................................<°}))><........
  ) ) ) ) )
( ( ( ( (    Prof. Philippe Grosjean
  ) ) ) ) )
( ( ( ( (    Numerical Ecology of Aquatic Systems
  ) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..............................................................

Nathan S. Watson-Haigh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 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
> 
> 
> - --
> - --------------------------------------------------------
> Dr. Nathan S. Watson-Haigh
> OCE Post Doctoral Fellow
> CSIRO Livestock Industries
> Queensland Bioscience Precinct
> St Lucia, QLD 4067
> Australia
> 
> Tel: +61 (0)7 3214 2922
> Fax: +61 (0)7 3214 2900
> Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html
> - --------------------------------------------------------
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkluio8ACgkQ9gTv6QYzVL5X9QCgwvg5xjwZW2A2Z5G41iADu1Kz
> hIkAoI5ISuAtHyQ+JwJSRBAc9q/oyeEt
> =cqm4
> -----END PGP SIGNATURE-----
> 
> ______________________________________________
> 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.
> 
>




More information about the R-help mailing list