[R] R CMD check testing environment
Ross Boylan
ross at biostat.ucsf.edu
Sat Aug 21 01:47:47 CEST 2004
I can't tell from the docs ("Writing R Extensions" 1.9.1) exactly what
environment the tests, examples, and vignettes that R CMD check tries to
run are in.
In particular:
1) how do I get the package loaded?
2) how do I access data in the data/ directory?
3) where is the material in the other directories? (e.g., has inst/
material been installed? where?)
Apparently (section 1.3) stuff in demo/ is not checked, which seems odd.
By inspecting some other packages, it seems the answer to 1) is that the
package is already loaded, so I don't need to say library(...). In
particular, I don't need to figure out what lib.loc is.
I have some C code as part of the package, so that (well the .so file)
needs to be loaded too.
2) Others seem to just say data(..), but this doesn't work for me.
I created the data with
save(gold, e2, q2, file="mspath/data/inputs", compress=TRUE)
and later renamed the file to inputs.RData. (check didn't think the
file counted without the extension).
I have tried to access it in my test script (under tests/) with both
load and data (e.g., data("inputs"), data("inputs.RData"),
data(inputs)). I get
> data(inputs)
Warning message:
Data set 'inputs' not found in: data(inputs)
For that matter, my assumed answer to 1) doesn't seem to be working out,
because when I try to access one of my functions it tells me it can't
find it. The function name is the same as the package name.
Perhaps the problem is I have inferred answers from \example{}, and the
story for tests/ is different.
Although I'm currently focussed on running a script in tests/, I'd like
to know what the story is for \examples in documentation or vignettes.
Thanks.
P.S. Is there a typical way to produce the .Rout.save file used in
tests/? What I'm doing is a slightly awkward 2-step process.
--
Ross Boylan wk: (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4 ross at biostat.ucsf.edu
Dept of Epidemiology and Biostatistics fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840 hm: (415) 550-1062
More information about the R-help
mailing list