0
votes

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?

1
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

1 Answers

1
votes

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()