R:namespaceExport(ns,exports)中的错误:undefined exports: [英] R: Error in namespaceExport(ns, exports) : undefined exports:

查看:1493
本文介绍了R:namespaceExport(ns,exports)中的错误:undefined exports:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Roxygen2编写了一个R包来创建帮助文件和NAMESPACE。当我去

  install_github(mintUser / bedarfspruefung3)

我得到以下输出和错误:

  *安装*源代码*包'bedarfspruefungV03'... 
** R
**为延迟加载准备包
**帮助
***安装帮助索引
**建筑物包索引
**测试是否可以加载已安装的包
名称空间导出(ns,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,等级
错误:加载失败

Roxygen正确构建了NAMESPACE文件:

<$ p $ ($ 4.0):不用手编辑

export(KiSt)
export(LST2014)
export(MLSTJAHR )
导出(M (MRE4AB)
出口(MRE4AB)
出口(MRE4AB)
出口(MRE4AB)
出口(MRE4AB)
出口
出口(MSONST)
出口(MST56)
出口(MVMT)
出口(MVSP)
出口(MZTABFB)
出口(SolZ)$ b (b)b出口(UPZ)b b出口(UPML)
出口(UPZ)b $ b出口出口(UPTAB14)
出口(UPVKV)
出口(UPVKVLZZ)
出口(bedarfspruefung2)
出口(leistungALGII2)
出口(等级)

所以任何人都知道NAMESPACE有什么问题?没有函数被导出到包环境 - 当我在 install_github 后运行 KiSt() library()我得到:找不到函数'KiSt'



谢谢!

解决方案

使用<< - 功能。感谢@kohske提示!


I have written a R package using Roxygen2 to create the help files and the NAMESPACE. When I go

install_github("mintUser/bedarfspruefung3")

I get the following output and error:

* 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 built the NAMESPACE file properly:

# 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)

So anyone an idea what's wrong with the NAMESPACE? No function gets exported to the package environment - when I run KiSt() after install_github and library() I get: Could not find function 'KiSt'

Thanks!

解决方案

The error arose by using <<- to define the functions. Thanks to @kohske for the hint!

这篇关于R:namespaceExport(ns,exports)中的错误:undefined exports:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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