Peng Yu
2009-Dec-09 22:34 UTC
[R] What is the development cycle where there are code in tests/ for package development?
I see 'library(stats)' at the beginning of R-2.10.0/src/library/stats/tests/nls.R. I'm wondering if I am developing my own package 'mypackage' whether I should put 'library(mypackage)' in a .R file in mypackage/tests/? If I do, then it seems awkward to me, because to use 'library(mypackage)', I have to first get 'mypackage' installed. So the development cycle is: try test cases in tests-> see bugs in 'mypackage' -> modify the code in 'mypackage' -> install 'mypackage'->try test cases in tests again.... But I think it would faster if the step of installing the package is avoid. So instead of using 'library(mypackage)', I'd think to use 'source(some_file_in_mypackage.R)' in any file in tests/. Could somebody let me know what is the current standard way of developing package. Why 'library(mypackage)' rather than 'source(some_file_in_mypackage.R)' is used?