Hi:
Another approach is:
v1 = c(1.2, 1.4, 0.9, 1.0, 1.1, 1.0)
v2 = c("aa", "cc", "bb", "bb", "cc", "bb")
v3 = c(8, 10, 11, 9, 9, 10)
df = data.frame(v1=v1, v2=v2, v3=v3)
ggplot(df) + geom_bar(aes(x = reorder(v2, desc(v3
HTH,
Dennis
On Wed, Oct 6, 2010 at 2:09 AM, Morten wrote:
>
> Hi all,
Hi Morten
Just order the factor the way you want before plotting:
df$v2 <- factor(df$v2, levels=c("bb", "cc", "aa"))
p = ggplot(df)
p + aes(v2) + geom_bar()
Best,
Ista
On Wed, Oct 6, 2010 at 5:09 AM, Morten wrote:
>
> Hi all,
>
> I have a large data frame and would like to make a barplot of a
Hi all,
I have a large data frame and would like to make a barplot of a categorical
variable with the bars sorted in order of decreasing frequency.
# Example:
v1 = c(1.2, 1.4, 0.9, 1.0, 1.1, 1.0)
v2 = c("aa", "cc", "bb", "bb", "cc", "bb")
v3 = c(8, 10, 11, 9, 9, 10)
df = data.frame(v1=v1, v2=v2,
Thanks, this indeed solved the problem.
Regards,
Dieter
On 4/08/2010 15:21, Shentu wrote:
>
> The reason you see the exra markers is that the first part of the command
> "qplot(DT$N,DT$D,fill=factor(DT$C))" already plots the individual points.
> You didn't see it with "geom_bar(stat = "identity"
The reason you see the exra markers is that the first part of the command
"qplot(DT$N,DT$D,fill=factor(DT$C))" already plots the individual points.
You didn't see it with "geom_bar(stat = "identity")" simply because the
stacked bars made the previous layer invisible. To see this you can use the
gg
On Aug 4, 2010, at 7:52 AM, Dieter Vanderelst wrote:
Dear List,
(self-contained example + version info at the bottom)
I'm having trouble producing a barplot using the functions in
ggplot2. When I use the position="dodge" option, the bars are
plotted but also a number of spurious markers.
Dear List,
(self-contained example + version info at the bottom)
I'm having trouble producing a barplot using the functions in ggplot2. When I
use the position="dodge" option, the bars are plotted but also a number of
spurious markers. More specifically, a number of black dots are plotted in t
Thierry:
That's exactly what I wanted, Thanks
> Dear Felipe,
>
> Is this what you want?
>
> library(ggplot2)
> mydata <- data.frame(PondName = factor(LETTERS[1:5]),
> avgWt = rnorm(5,
> mean = 10, sd = 3))
> ggplot(mydata, aes(x = PondName, y = avgWt)) + geom_bar()
> ggplot(mydata, aes(x = PondN
ipe Carrillo
Verzonden: maandag 23 juni 2008 2:09
Aan: [EMAIL PROTECTED]
Onderwerp: [R] ggplot2-barplot
Hi all:
I have been using ggplot2 graphics for quite some time now and I really
like it. However, I haven't used barplots enough to understand the
arquitecture behind it. Can someone show me how
Hi all:
I have been using ggplot2 graphics for quite some time now and I really like
it. However, I haven't used barplots enough to understand the arquitecture
behind it. Can someone show me how to make this simple barplot graph with
ggplot2? I want "PondName" along the x axis and "avgWt" along
10 matches
Mail list logo