I want to show different countries Index scores on the y axis for a metric column in my dataframe(discrete variable) and color the points based on the country.
The snippet of dataframe, test:
Countries | Metric | Index Score |
---|---|---|
UK | Equity | 99.1 |
USA | Equity | 6.9 |
France | Equity | 75.4 |
ggplot(test,aes( x= Metric , y= "Index Score", color = Countries)) +
geom_point()
The output currently looks like this: all points are on top of each other and not dispersed
Do y = `Index Score`
, a string is not valid.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.