Why is graph a straight line after using geom_point function?

ggplot(data=data_2015)+geom_point(mapping=aes(x=Freedom,y="Happiness Rank"))

I’ll bet the problem you’re having is because you put Happiness_Rankin quotes. If you get rid of those does that solve the problem?

If not, please post a Reprex and I’d be happy to help.

Try this

y=`Happiness Rank`

or rename it:

data_2015 <- data_2015 %>%
rename(Happiness_Rank = `Happiness Rank`)

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.