I am trying to create a ggplot using this code.
df <- read.csv("2019.csv", header = TRUE, sep = "," )
head(data)
ggplot(data = df, aes(x = 'GDP.per.capita', y = 'Social.support')) +
geom_line(color = "red", size = 1) +
geom_point(size = 2)
but on the console i'm getting a warning message
1: In geom_line(color = "red", size = 1) :
All aesthetics have length 1, but the data has 156 rows.
ℹ Please consider using `annotate()` or provide this layer with data containing a single
row.
2: In geom_point(size = 2) :
All aesthetics have length 1, but the data has 156 rows.
ℹ Please consider using `annotate()` or provide this layer with data containing a single
row.
Went to YT but everyone was doing the same thing I'm doing. they are not getting any message but I'm getting this message.