Skip to content
Prev 374757 / 398513 Next

Plot qualitative y axis

Hi Pedro,
melt() is probably working. The problem is I did not finish the copy and paste.? It would have been better if I had included the ggplot() command. 

Try 
==============================================================
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)

ggplot(dat2, aes(N, value, colour = variable, group = variable)) +
????? geom_point() + geom_line()
=============================================================
I feel very stupid.
On Tuesday, May 22, 2018, 10:40:09 p.m. EDT, Pedro p?ramo <percentil101 at gmail.com> wrote:
Many thanks,

My goal is to make a plott like attached but the Y axis starts in XIV and
end at top in I.? Generally for instance in excel X axis is categories but
Y axis is numbers I want the contrary plotted in lines, your last help is
near what I look but barplot is not needed.

Hope you can help me thanks in advance.

2018-05-22 0:58 GMT+02:00 Jim Lemon <drjimlemon at gmail.com>:
??? [[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.