[R] Adding an Sweave Vignette to a package

Doran, Harold HDoran at air.org
Mon Jan 21 21:45:01 CET 2008


I'm finalizing development of a package that will include a vignette.
Without the vignette, the package builds fine with no warnings and is
ready for distribution. Now, I am following the directions for
developing vignettes "Sweave, Part II: Package Vignettes" by Friedrich
Leisch.

I am using a windows XP machine (other session info below). Here is what
I have done.

1) I add the 'inst/doc' directory to the package source tree.
2) I have added the following information in the preamble of the .Rnw
file

% \VignetteIndexEntry{An \texttt{R} Package for Miscellaneous
Psychometric Analyses}
% \VignetteDepends{MiscPsycho, statmod}
% \VignetteKeyword{misc}

3) I then copy the file "MP.Rnw" to the 'inst/doc' directory.
4) I then run Rcmd build g:\MiscPsycho

The process begins as usual and it even tries to create the vignette.
However, it runs into an error at code chunk 1 complaining that it
cannot find the function called simRasch(). This simRasch function is
one of the functions developed for this package and one that will exist
only when the package is built. The build process is halted.

I'm not sure how to handle this. Any advice is appreciated.

Harold

> sessionInfo()
R version 2.6.1 (2007-11-26) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


other attached packages:
[1] statmod_1.3.3

loaded via a namespace (and not attached):
[1] tools_2.6.1



More information about the R-help mailing list