Yang Mei Lian - 2 months ago 28

R Question

I have two vectors with different lengths in R, which contains integer number only (1,2,3,4,5). I want to plot histogram of them (in percentage, not in count) one by one.

I tried to use

`multhist`

`plotrix`

- It plots with as count, not percentage.
`y-axis`

- It plots with as float number, such as 1.1, 1.5, etc. while obviously I only need to plot with
`x-axis`

at 1, 2, 3, 4, 5.`x-axis`

How could I do that in R?

Thank you very much,

the code with

`multhist`

``

`x1 <- round(runif(1000, 1.0, 5.0), digits=0)`

x2 <- round(runif(100, 1.0, 5.0), digits=0)

require (plotrix)

multhist (x1,x2)

``