How to insert data for graphing in ggplot

3

I want to make a line graph with ggplot, but this message appears:

  

Error: Do not know how to add geom_point to a plot

Here's the template I'm doing:

a<-c(4.9, 4.4, 4.2, 3.9, 3.7, 3.5, 3.1, 3, 2.9, 3, 2.8, 2.7, 2.6, 2.5)
b<-c(0.97, 1.13, 1.19, 1.14, 1.16, 1.25, 1.24, 1.46, 1.62, 1.94, 1.36, 1.91, 1.8, 1.89)
Ano<-c(1999:2012)
dados<-data.frame(a,b,Ano)
ggplot(dados, aes(x=Ano,y=a))
+geom_point
    
asked by anonymous 26.10.2014 / 21:47

1 answer

3

You just have to put the parentheses after geom_point , since geom_point is a function that you should call:

ggplot(dados, aes(x=Ano,y=a)) + geom_point()
    
27.10.2014 / 11:04