the \tests subdirectory in a R-package [Power / Sample Size]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2013-06-12 01:03 (4749 d 10:02 ago) – Posting: # 10773
Views: 9,535

(edited on 2013-06-12 22:47)

Dear Detlew,

Just happen to be here. I find these are all ready-to-run scripts under .../tests folder. You may consider to put these .R scripts under PowerTOST/R folder, and then create a /PowerTOST/demo folder with a file called '00Index' which should contain the following texts.
RatioF_test     test for blabla...
parallel_test   test for blabla...
...

Except for the file '00Index' under /PowerTOST/demo, you will need the following files under /PowerTOST/demo depending on how many test files you have:
RatioF_test.R
parallel_test.R
...


Taking 'RatioF_test.R' as an example (similar with others), it has only one line itself as follow:
test_RatioF()

After compliled and installed, then users can easily access the test files from R console.
library(PowerTOST)
demo(RatioF_test)     ### will run test_RatioF.R
demo(parallel_test)   ### will run test_parallel.R
...


Currently, users can go to R folder/library/PowerTOST/tests to open any .R script with an ASCII editor. Select all scripts and copy. And then paste under R console to run. In this case, the screen of R console may look messed because of mixing up the codes and outputs all together. Using demo(...) way will be much, much better. It won't show any R scripts or codes, but only outputs. Clean and beautiful.

❝ [...]

❝ 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?

❝ [...]


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;
126 visitors (0 registered, 126 guests [including 30 identified bots]).
Forum time: 11:05 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