Hi Pedro,
Not too hard. Just have to watch the order of the variables:
ppdf<-read.table(text="N M W
I 10 106
II 124 484
III 321 874
IV 777 1140
V 896 996
VI 1706 1250
VII 635 433
VIII 1437 654
IX 693 333
X 1343 624
XI 1221 611
XII 25 15
XIII 3 NA
XIV 7 8",
header=TRUE)
plot(rev(ppdf[,2]),1:14,col=
ct.org] On Behalf Of John Kane via
> R-help
> Sent: Wednesday, May 23, 2018 12:41 PM
> To: Jim Lemon ; R-help ;
> Pedro páramo
> Subject: Re: [R] Plot qualitative y axis
>
> Hi Pedro,
> melt() is probably working. The problem is I did not finish the copy and
> paste. I
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",
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
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",
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
Hi all,
I´m trying to plot this data
N M W
I 10 106
II 124 484
III 321 874
IV 777 1140
V 896 996
VI 1706 1250
VII 635 433
VIII 1437 654
IX 693 333
X 1343 624
XI 1221 611
XII 25 15
XIII 3
XIV 7 8
So that in de Y axis will be the level (qualitative data) and in the X axis
will be M and W variables.
7 matches
Mail list logo