Skip to content
Prev 374701 / 398513 Next

Plot qualitative y axis

What I think is the ggplot2 version of what you want. Note that I am using the reshape2 package which is a bit old fashioned.? 

=============================================================library(reshape2)
library(ggplot2)

dat1? <- structure(list(N = c("I", "II", "III", "IV", "V", "VI", "VII", 
"VIII", "IX", "X", "XI", "XII", "XIII", "XIV"), M = c(10L, 124L, 
321L, 777L, 896L, 1706L, 635L, 1437L, 693L, 1343L, 1221L, 25L, 
3L, 7L), W = c(106L, 484L, 874L, 1140L, 996L, 1250L, 433L, 654L, 
333L, 624L, 611L, 15L, NA, 8L)), .Names = c("N", "M", "W"), class = "data.frame", row.names = c(NA, 
-14L))

dat2? <- melt(dat1)


=============================================================
On Monday, May 21, 2018, 10:47:54 a.m. EDT, Bert Gunter <bgunter.4567 at gmail.com> wrote:
See ?barplot and set the horiz? argument to TRUE.

(This is in the base R plotting version. The ggplot2 and lattice systems
have other ways of doing this)

Note: if you search on e.g. "barplots in R" or similar, you should find
numerous examples with code.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Mon, May 21, 2018 at 5:44 AM, Pedro p?ramo <percentil101 at gmail.com>
wrote:
??? [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.