rdocumentationpackageroxygen

Using source subdirectories within R packages with roxygen2


I would like to use a directory structure within the R folder for the source code of a package. For example, within my R folder I have an algos folder with functions I want to export and document. However roxygen2 by default does not seem to go through the subfolders of the R folder.

I tried to use the @include keyword as follows for a file at `R/algos/algo1.r'

#' @include algos/algo1.r

but without success. Is there a simple way to use subfolder for the R source code?


Solution

  • Writing R Extensions has this to say (in Section 1.1.5) about subdirectories under the R directory:

    The R and man subdirectories may contain OS-specific subdirectories named unix or windows.

    Implied in this is that they can't have other subdirectories other than those two. This is confirmed in an r-devel thread and again later in another r-devel thread.