# [R] Constructing a barplot in R

Rolf Turner r.turner at auckland.ac.nz
Fri Mar 6 00:53:46 CET 2009

```On 6/03/2009, at 12:03 PM, SIrEllwood wrote:

>
> Hi all,
>
> 3.  The probabilities are 0.06, 0.21, 0.24, 0.18, 0.14, 0.10, 0.04,
> 0.02 and
> 0.01 that an airline will
>
> e(x) and e(x^2)
>
> Give the R commands you use and the two numerical values.
>
> Use the sample function to simulate complaints over 500 days. Give
> the R command you use and draw a barplot of the simulated data.
> Comment on
> how the pattern
> you see relates to the probabilities in the question above.
>
> I think i have done the first part and got e(x) = 2.75 and e(x^2)=
> 10.59
>
> I have no idea how to simulate complaints over 500 days and draw a
> barplot.
>
> can anyone help?

From the Posting Guide:

Basic statistics and classroom homework:  R-help is not intended for
these.

cheers,

Rolf Turner

P. S.  Your homework question says ``Use the sample function''  So
on the sample function:

?sample

You will also find ?barplot useful.
R. T.

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

```