0

Getting error on executing code

scorecardData  <- data.frame(
   Date = 
c("05/10/2019","06/10/2019","07/10/2019","08/10/2019","09/10/2019"),
   Incoming.Calls= c(10,20,15,5,7)) 


ggplot(data = scorecardData, aes(x = factor(Date), y = Incoming.Calls)) +
  geom_line()

Getting error message : geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?

Aman Khanna
  • 367
  • 3
  • 7
  • 16
  • It plots without errors when you use `aes(x = Date, y = Incoming.Calls, group = 1)` inside the ggplot call. Not sure why the error occurs though. – teunbrand Oct 17 '19 at 09:36

1 Answers1

1

you need to set group = 1 see here

scorecardData  <- data.frame(
    Date = 
        c("05/10/2019","06/10/2019","07/10/2019","08/10/2019","09/10/2019"),
    Incoming.Calls= c(10,20,15,5,7)) 


ggplot(data = scorecardData, aes(x = Date, y = Incoming.Calls, group = 1)) +
    geom_line()
dasds
  • 170
  • 1
  • 11