I have a Database, and want to show a figure using stat_smooth.
I can show the avg_time vs Scored_Probabilities figure, which looks like this:
c <- ggplot(dataset1, aes(x=Avg.time, y=Scored.Probabilities))
c + stat_smooth()
But when changing Avg.time to time or Age, an error occurs:
c <- ggplot(dataset1, aes(x=Age, y=Scored.Probabilities))
c + stat_smooth()
error: geom_smooth: Only one unique x value each group. Maybe you want aes(group = 1)?
How could I fix it?
stat_smooth
only works with continuous variables. Yourage
variable is a character variable. I can only assume that thetime
variable is also not saved as time, but character instead. You first have to convert your variables to numeric in a meaningful way. – Alarice