我使用Roxygen2编写了一个R包来创建帮助文件和NAMESPACE。我去的时候
install_github("mintUser/bedarfspruefung3")
我收到以下输出和错误:
* installing *source* package ‘bedarfspruefungV03’ ...
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in namespaceExport(ns, exports) :
undefined exports: KiSt, LST2014, MLSTJAHR, MOSONST, MRE4, MRE4ABZ, MRE4ALTE, MRE4JL, MRE4SONST, MSOLZ, MSONST, MST56, MVMT, MVSP, MZTABFB, SolZ, SozV, UP56, UPANTEIL, UPEVP, UPLSTLZZ, UPMLST, UPTAB14, UPVKV, UPVKVLZZ, bedarfspruefung2, leistungALGII2, rating
ERROR: loading failed
Roxygen正确构建了NAMESPACE文件:
# Generated by roxygen2 (4.0.2): do not edit by hand
export(KiSt)
export(LST2014)
export(MLSTJAHR)
export(MOSONST)
export(MRE4)
export(MRE4ABZ)
export(MRE4ALTE)
export(MRE4JL)
export(MRE4SONST)
export(MSOLZ)
export(MSONST)
export(MST56)
export(MVMT)
export(MVSP)
export(MZTABFB)
export(SolZ)
export(SozV)
export(UP56)
export(UPANTEIL)
export(UPEVP)
export(UPLSTLZZ)
export(UPMLST)
export(UPTAB14)
export(UPVKV)
export(UPVKVLZZ)
export(bedarfspruefung2)
export(leistungALGII2)
export(rating)
所以任何人都知道NAMESPACE有什么问题?没有函数导出到包环境 - 当我在KiSt()
和install_github
后运行library()
时,我得到:Could not find function 'KiSt'
谢谢!
答案 0 :(得分:1)
使用<<-
定义函数时出现错误。感谢@kohske的提示!