楼主: lcr422
1404 6

[问答] 问一个简单的向量名称问题 [推广有奖]

  • 0关注
  • 0粉丝

小学生

78%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
54 点
帖子
9
精华
0
在线时间
9 小时
注册时间
2011-8-10
最后登录
2016-6-2

楼主
lcr422 发表于 2011-9-13 21:22:37 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
一个向量的名字为%WC,在做glm的时候formula=Mortality~%WC,提示说%WC有问题,直接输出%WC也有问题,请问这样要怎么用%WC,在不改名字的基础上,刚开始用R,请多关照~谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:mortality Formula form ORM 多关照 改名字

沙发
qoiqpwqr 发表于 2011-9-13 21:50:32
变量名字不能有%号吧。

藤椅
毓闻 学生认证  发表于 2011-9-14 02:43:03
The set of symbols which can be used in R names depends on the operating system and country
within which R is being run (technically on the locale in use). Normally all alphanumeric
symbols are allowed1 (and in some countries this includes accented letters) plus ‘.’ and ‘_’, with
the restriction that a name must start with ‘.’ or a letter, and if it starts with ‘.’ the second
character must not be a digit. Names are currently effectively unlimited, but were limited to
256 bytes prior to R 2.13.0. (from R-intro)
不知道为什么楼主会发现有变量名是%WC的。

板凳
ltx5151 发表于 2011-9-14 08:09:50
LZ好奇怪的要求啊,为什么不能改名字呢?

报纸
trier2006 发表于 2011-9-14 09:36:20
去掉%,换个其它前缀
最好的医生是自己,最好的药物是时间……

地板
wlgyyk 发表于 2011-9-16 00:11:20
还是改名吧,建议楼主不要把变量的第一个字符用符号表示

7
lcr422 发表于 2011-9-16 01:24:34
可是我用names(x)<-"%WC"
然后输出x
会显示%WC..
老师也把名字改了。。。谢谢各位了~

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

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