How to add the geom_line in this graph with this data?

Hi, I'm very new to R and I have a question.
This is an example of the problem I have, I can't add the geom_line () to join the points

library(ggplot2)
library(tidyverse)
library(dplyr)

Month <- c ('Abril', 'August', 'December', 'July', 'June', 'May','November','Octuber','September')
BlY <- c(100, 92.98,95.93,91.81,93.28,90.92,92.94,93.67,95.40)

#Data Frame
Example <- data.frame(Month,BlY)

Example%>%
  #------------------------------------------------
  ggplot(Example,mapping = aes(x =Month, y = BlY))+
  geom_point()+
  theme_classic()+
  theme(axis.text.x=element_text(angle=90, vjust=0.5, hjust=0))+
  geom_line() #The problem is here, That's what I think!!
#------------------------------------------------

Hi @Raptor,

Try this:

Example %>%
ggplot(aes(x = Month, y = BlY)) +
  geom_point() +
  geom_line(group = 1) +
  theme_classic() +
  theme(axis.text.x=element_text(angle=90, vjust=0.5, hjust=0))
1 Like

@mattwarkentin
wooow, oh my god, 2 times you have helped me on this day, really, thank you very much !!!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.