[Roxygen-devel] DESCRIPTION file generation + roxygen() error + multiple keywords

Laurent Gatto laurent.gatto at gmail.com
Fri Oct 1 23:49:47 CEST 2010


Dear Vinh,

See my comments below.

On 1 October 2010 00:39, Vinh Nguyen <vqnguyen at uci.edu> wrote:
> Dear list,
>
> I'm new to creating R packages and am jumping right into roxygen as it
> allows for the documentation part of package creation easier.  Some
> questions:
>
> 1.  I'm following the vignette of roxygen.  For the package
> documentation, packagename-package.R(d), does nothing from this chunk
> get transcribed into the DESCRIPTION file at all?  Example:
>
> #' Tests pseudoprimality by Fermat's little theorem.
> #'
> #' \tabular{ll}{
> #' Package: \tab pseudoprime\cr
> #' Type: \tab Package\cr
> #' Version: \tab 0.1\cr
> #' Date: \tab 2008-08-24\cr
> #' License: \tab GPL (>= 2)\cr
> #' LazyLoad: \tab yes\cr
> #' }
> #'
> #' Using the Fermat primality test, pseudoprime checks for primes
> #' probabilistically; the test is fooled every time by Carmichael
> #' numbers.
> #'
> #' \code{\link{is.pseudoprime}} checks a number \code{n} for
> #' pseudoprimality, applying Fermat's test \code{times} times.
> #'
> #' @name pseudoprime-package
> #' @aliases pseudoprime
> #' @docType package
> #' @title Tests pseudoprimality by Fermat's little theorem
> #' @author Peter Danenberg \email{pcd@@roxygen.org}
> #' @references
> #' \url{http://en.wikipedia.org/wiki/Fermat's_little_theorem}
> #' @keywords package
> #' @seealso \code{\link{is.pseudoprime}}
> #' @examples
> #' is.pseudoprime(13, 4)
> roxygen()
>
> The tabular part seems to go into a DESCRIPTION file.  Is there a way
> (or plans) to update the DESCRIPTION file based on this chunk?  Am I
> missing something?  I think having this piece of information in one
> place as opposed to two is easier on the maintainer.

The package documentation (i.e man/packagename-package.Rd) and the
DESCRIPTION file are different beasts. In general, I don't think that
package documentation stuff is meant to be added to the DESCRIPTION
file. As far as I know, roxygen does update the DESCRIPTION file's
Collate field, but I think that's all. I could not reproduce the
update of the DESCRIPTION file based on the tabular information when
running R CMD roxygen.

> 2.  I get an error saying roxygen() is not found when running R CMD
> check after roxygenize().  Should we always specify that our package
> depends on roxygen in order for it to pass this?  roxygen() is in the
> .R file after running package.skeleton() and roxygenize().

You could also change roxygen() by NULL at the end of the file. This
should fix your issue, but I don't know what the error you describe
means and why it is returned. Anyway, there shouldn't be any
requirement to specify roxygen as a dependency.

> 3  How should multiple keywords be spelled out in the documentation
> chunk?  Commas didn't work for me.  One word per @keywords tag?

Several keywords separated by a space:
@keywords keyword1 keyword2

Hope this helps.

Best wishes,

Laurent

> Thanks so much!
>
> Vinh
> --
> Vinh Nguyen
> Department of Statistics
> Donald Bren School of ICS
> 2231 Bren Hall
> University of California, Irvine
> Irvine, CA 92607
> vqnguyen at uci.edu | http://www.ics.uci.edu/~vqnguyen/
> Schedule a meeting: http://tungle.me/VinhNguyen
> _______________________________________________
> Roxygen-devel mailing list
> Roxygen-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
>


More information about the Roxygen-devel mailing list