使用roxygen2的R包中的源子目录 [英] Using source subdirectories within R packages with roxygen2

查看:119
本文介绍了使用roxygen2的R包中的源子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 R 文件夹中使用一个目录结构作为软件包的源代码。例如,在我的 R 文件夹中,我有一个 algos 文件夹,其中包含要导出和记录的功能。但是,默认情况下, roxygen2 似乎没有通过 R 文件夹的子文件夹。

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.

我试图在`R / algos / algo1.r上的文件中使用 @include 关键字如下'

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

#' @include algos/algo1.r

但没有成功。有没有一个简单的方法来使用子文件夹的 R 源代码?

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

推荐答案

p> 撰写R扩展程序有这样的说法(在第1.1.4节) :

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


R man 子目录可能包含名为 unix windows 的操作系统专用子目录。

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

这里暗示,他们不能拥有除这两个以外的其他子目录。这在一个r-devel线程中得到证实稍后在另一个r-devel线程

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.

这篇关于使用roxygen2的R包中的源子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆