If you give us Summary, you will have a better chance of getting an
answer. Preferably the result of dput(Summary), though possibly only a
subset of that if Summary is large (over 100 rows, say).
> A.tmp<- hist(A[,'A1'], breaks = (1,2,3,4,5,10), plot = FALSE)
> B.tmp<- hist(B[,A1'], breaks = (1,2,3,4,5,10), plot = FALSE)
There is at least a typo here; you are missing a quote before A1.
> plot.new()
>
> plot(A.tmp$counts/sum(A.tmp$counts), type = 'b',
> axes = FALSE, ylim = c(0, 0.45), pch = 20, xlim = c(0.5, 4.5), cex =
> 0.8,
> lty = 1, col = 'black)
>
> lines(B.tmp$counts/sum(B.tmp$counts), type = 'b',
> axes = FALSE, ylim = c(0, 0.45), pch = 20, xlim = c(0.5, 4.5), cex =
> 0.8, lty = 2, col = 'red')
>
> axis(1, at = seq(0.5, 5, by = 1), labels = FALSE)
> axis(1, at = seq(1, 4, by = 1), labels =
> c("1-2","2-3","3-4","4-5","5-10") tick = FALSE)
> axis(2)
>
> legend(x = 3, y = 0.1, c("A" , "B"), cex = 0.8, col = c("black",
> "red"), lty = c(1,2));
>
> abline(v = 2.5, col = "black")
>
> I made some changes to names so it's clearer. The values in A1 are
> integers from 1-300. I tried to do the same with ggplot but keep
> getting errors like ggplot does not know how to deal with this data
> etc. Is there a way to plot something exactly like in the example
> using ggplot? Thanks for help
>
>
> Maria
>
--
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University