upabove
upabove

Reputation: 1119

Plotting histogram using ggplot2 for 2 numbers

I would like to create a plot from two values:

results<-data.frame(name=c("A","B"), values=c("0.8639503","0.7870299"))
qplot(name, data=results, geom="bar")

This gives me a plot, where the difference between the two bars is invisible. Can someone help how to create this plot so that the differences are visible?

Upvotes: 0

Views: 82

Answers (1)

Jaap
Jaap

Reputation: 83275

Using:

ggplot(results, aes(x=name, y=values)) +
  geom_bar(stat="identity")

will give you the desired result

Upvotes: 2

Related Questions