R语言做直方图,怎么出现“参数没用”,怎么修改什么意思

>coin_tosses=function(n)+{+s=sample(0:1,n,replace=TRUE)+}>outcome=function(x)+{+i=1+w... > coin_tosses=function(n)
+ {
+ s=sample(0:1,n,replace=TRUE)
+ }
> outcome=function(x)
+ {
+ i=1
+ w=0
+ j=length(x)
+ while(i<=j)
+ {
+ if(x[i]==1)
+ {w=w+1}
+ else
+ {w=w-1}
+ i=i+1
+ }
+ z=w
+ }
> test_1000=function(m)
+ {
+ i=1
+ while(i<=m)
+ {
+ a=coin_tosses(1000)
+ b=outcome(a)
+ c[i]=b
+ i=i+1
+ }
+ y=c
+ }
>
> x=test_1000(100)
> hist(x)
Error in hist(y, col = "gray", main = "Histogram of the final profit/loss in each game", :
参数没有用(col = "gray", main = "Histogram of the final profit/loss in each game", xlab = "The final profit/loss of each game")
此外: There were 29 warnings (use warnings() to see them)
>
展开
 我来答
未签收Cr
2016-10-02 · TA获得超过613个赞
知道小有建树答主
回答量:1668
采纳率:33%
帮助的人:112万
展开全部
hist(x) 还是 hist(y) ???
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式