全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1251 1
2012-03-13
最近在学习R的object-oriented programming.
在实践某课件的下面例子(扩展加号算符的功能,可以使之粘连两个字符):
setMethod('+',c('character','character'),function(e1,e2)paste(e1,e2,sep=''))
时,有这样的出错信息:
错误于setMethod("+", c("character", "character"), function(e1, e2) paste(e1,  :
  函数'+'的方法和'e1="character", e2="character"'标记都被封闭了,因此无法将之重新定义

不知道是什么原因,请坛上高人解答,谢谢。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-3-13 16:12:32
msgid ""
"the method for function %s and signature %s is sealed and cannot be re-"
"defined"
msgstr "函数%s的方法和%s标记都被封闭了,因此无法将之重新定义"

可能是以下问题导致...
sealed         If TRUE, the method so defined cannot be redefined by another call to setMethod (although it can be removed and then re-assigned). Note that this argument is an extension to the definition of setMethod in the reference.
http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/methods/html/setMethod.html
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群