为了账号安全,请及时绑定邮箱和手机立即绑定

sample函数获得的数据框为何下面是“+”号?而且eyecolor变量不能看?

> sample(eye.color,100,rep=T)

  [1] "bb" "aa" "cc" "dd" "cc" "cc" "bb" "dd" "cc" "cc" "dd" "bb" "cc" "dd" "cc"

 [16] "aa" "cc" "aa" "aa" "bb" "aa" "cc" "aa" "bb" "bb" "dd" "cc" "bb" "dd" "dd"

 [31] "dd" "dd" "cc" "cc" "dd" "aa" "dd" "aa" "cc" "aa" "cc" "aa" "dd" "dd" "cc"

 [46] "aa" "bb" "dd" "cc" "bb" "bb" "dd" "cc" "bb" "bb" "aa" "bb" "aa" "dd" "dd"

 [61] "aa" "aa" "aa" "cc" "bb" "aa" "cc" "bb" "bb" "bb" "aa" "bb" "dd" "aa" "aa"

 [76] "aa" "aa" "aa" "cc" "dd" "aa" "bb" "cc" "dd" "dd" "bb" "bb" "dd" "aa" "bb"

 [91] "bb" "aa" "dd" "cc" "cc" "bb" "bb" "dd" "dd" "bb"

> eyecolor<-data.frame(id=1:100,color=sample(eye.color,100,rep=T)   #sample函数获得的数据框为何下面是“+”号?


> eyecolor

Error: object 'eyecolor' not found


正在回答

1 回答

+说明你的语句没有写完整啊。。  

你自己看下,data.frame后面的括号,在语句最后并没有完整封闭。。就是语句最后面漏了个括号

1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

sample函数获得的数据框为何下面是“+”号?而且eyecolor变量不能看?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信