OT: issue of '\tests' subdir again [Power / Sample Size]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2013-09-29 01:23 (4640 d 07:00 ago) – Posting: # 11574
Views: 9,064

Dear Detlew,

Recently I added one more subdirectory '\tests' to my packages because I was asked to add 'test' by CRAN maintainer. Thus it reminds me your previous post again. I saw you put the subdir '\tests' under '\inst', not the same subdir of '\R'. In this case, there are two subdir under '\inst': one is '\tests' and the other is '\doc' in your PowerTOST package. After installation, both '\tests' and '\doc' will appear under package directory. If you want to test if all these R scripts work properly (not for demo), you probably should move 'tests' subdir from '\inst\tests' to '\tests'. That is one more upper level and the same dir as '\R'. (Reference:Writing R Extensions). Then when you check your package with command line of R CMD check --as-cran pk-name, you will see if all test codes are OK. For example, I check my package stab, I get the following message:

F:\R>R CMD check --as-cran stab

* using log directory 'F:/R/stab.Rcheck'
* using R version 3.0.2 (2013-09-25)
* using platform: i386-w64-mingw32 (32-bit)
...[cut many lines here] * checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking examples ... NONE
* checking for unstated dependencies in tests ... OK
* checking tests ...
  Running 'stab_test_run.R'
 OK
      <--- here shows all results of test runs (I just had one test file for this example)
* checking PDF version of manual ... OK

See
  'F:/R/stab.Rcheck/00check.log'
for details.


Under the directory of '\stab.Rcheck', there is subdir called '\tests' and all results (outputs) of test runs can be found there with file extension of .Rout. In this case, the subsir '\tests' won't be included in the binary package file, but it is still included in the source tarball. That is the subdir '\tests' will not appear under package after package installation. I don't know if this is what you want or not. I guess CRAN maintainer will depend on this to examine if there is any 'test' included with a package. If you put '\tests' under '\inst', you will not see the messages of '* checking tests ...'

ps. Helmut could not find the subdir '\tests' in his previous post. That was because you added subdir of '\inst\tests' since v0.9-10. However, at that moment (2012-01-02), what Helmut installed was v0.9-0 or even earlier ver. Of course, there was no subdir of '\tests' yet. From CRAN archives, it shows:
...
PowerTOST_0.9-0.tar.gz  2011-Dec-15 18:07:47   255.8K   application/x-gzip
PowerTOST_0.9-10.tar.gz 2012-Jul-20 14:14:36   299.7K   application/x-gzip
...


Helmut should be able to find '\tests' subdir now.

❝ ...

❝ Seems I hadn't really understand what the purpose of the \tests subdirectory in a R-package is for and how it functions. Any R guru out there which don't let me die in blithe ignorance?

❝ Until I have fixed this issue you can download the source code tarball to get access to the scripts.

❝ ...


All the best,
-- Yung-jin Lee
bear v2.9.6:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here

Complete thread:

UA Flag
Activity
 Admin contact
23,653 posts in 4,991 threads, 1,570 registered users;
109 visitors (0 registered, 109 guests [including 25 identified bots]).
Forum time: 08:24 CEST (Europe/Vienna)

To propose that poor design can be corrected by subtle analysis techniques
is contrary to good scientific thinking.    Stuart J. Pocock

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5