是否可以制作一个只从其他R包中导出所有功能的R包?是否有另一种方法可以将包中的功能分类并在手册,代码文件等中进行相应的排序。?
答案 0 :(得分:1)
是的,您可以拥有一个仅针对其依赖项调用的包。作为一个突出的例子,now-archived gregmisc package最初被分解为单独的包,它们以不同功能的大量集合开始。虽然gregmisc在CRAN上仍然可用但它不包含任何功能,只有这个启动功能:
.onAttach <- function(libname, pkgname)
{
packageStartupMessage(
"All functionality of the `gregmisc' package has been moved",
"into the four 'g' packages: gdata, gtools, gmodels, and gplots. ",
"This package is retained to make it easy to install and load",
"the full set. Please consider loading these packages directly."
)
}
然后只依赖于描述文件中描述的新分离包:
Package: gregmisc
Title: Greg's Miscellaneous Functions
Description: Description: The former gregmisc bundle is a repository
for a variety of useful functions. The gregmisc package has
been split into a set of more focused packages: gdata, gmodels,
gplots, gtools. The purpose of this 'new' gregmisc is to
provide an easy way to access the original combined
functionality. To this end, it simply depends on all of the
new packages so that these will installed/loaded when this
package is installed/loaded.
Depends: gdata, gmodels, gplots, gtools
Version: 2.1.5
Author: Gregory R. Warnes.
Maintainer: Gregory R. Warnes <greg@warnes.net>
License: GPL-2
Packaged: 2013-06-28 21:48:38 UTC; warnes
NeedsCompilation: no
Repository: CRAN
Date/Publication: 2013-06-29 00:15:57