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?
Writing R Extensions has this to say (in Section 1.1.5) about subdirectories under the R directory:
The
R
andman
subdirectories may contain OS-specific subdirectories namedunix
orwindows
.
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.
来源:https://stackoverflow.com/questions/14902199/using-source-subdirectories-within-r-packages-with-roxygen2