楼主: hugebear
1295 1

[问答] 怎么理解并规避以下出错信息 [推广有奖]

  • 4关注
  • 17粉丝

已卖:194份资源

副教授

33%

还不是VIP/贵宾

-

威望
0
论坛币
1837 个
通用积分
170.4848
学术水平
64 点
热心指数
94 点
信用等级
34 点
经验
29760 点
帖子
430
精华
0
在线时间
1192 小时
注册时间
2010-8-15
最后登录
2025-11-23

楼主
hugebear 发表于 2012-3-13 11:55:36 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
最近在学习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"'标记都被封闭了,因此无法将之重新定义

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

扫码加我 拉你入群

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

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

关键词:Programming Character function Oriented Program character function 信息

沙发
ryusukekenji 发表于 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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-7 19:40