RLab2 sim_streak bar plot

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

RLab2 sim_streak bar plot

brice
When i populate my bar plot, the x-axis is not labeled and i'm not sure what i am looking at since its set up different then the kobe bar plot. Can someone help me figure out how i can get these frequency tables' data.
Reply | Threaded
Open this post in threaded view
|

Re: RLab2 sim_streak bar plot

Darth Knight
Can you show me the code you have used for the bar plot?
Reply | Threaded
Open this post in threaded view
|

Re: RLab2 sim_streak bar plot

brice
> sim_basket <- sample(outcomes, size = 133, replace = TRUE, prob = c(0.45,0.55))
> table(sim_basket)
sim_basket
 H  M
62 71
Reply | Threaded
Open this post in threaded view
|

Re: RLab2 sim_streak bar plot

brice
> sim_streak <- calc_streak(sim_basket)
> barplot(sim_streak)
Reply | Threaded
Open this post in threaded view
|

Re: RLab2 sim_streak bar plot

Darth Knight
How about "barplot(table(sim_streak))" instead of "barplot(sim_streak)"?
This might work in this case.
Reply | Threaded
Open this post in threaded view
|

Re: RLab2 sim_streak bar plot

brice
Thanks, that works perfect. And now i see that that is how it did in the previous part of the assignment
Reply | Threaded
Open this post in threaded view
|

Re: RLab2 sim_streak bar plot

Darth Knight
No trouble.
I believe so. There might be another way for doing this.
But, this seems just fine.