慕设计226598
2019-04-08 20:32
> 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
+说明你的语句没有写完整啊。。
你自己看下,data.frame后面的括号,在语句最后并没有完整封闭。。就是语句最后面漏了个括号
R语言入门与进阶
20104 学习 · 19 问题
相似问题