How to change legend name and legend values?

Viewed 124

This is my code

p <- ggplot(data=predicted.data, aes(x=rank, y=probability.of.edu)) +
  geom_point(aes(color=edu), shape=4, stroke=2, size=5) +
  xlab("Index") +
  ylab("Predicted probability of education dependence") 
p
    

Variable edu is binary with values 0, 1.

Output looks like:

enter image description here

I want to change legend title, and legend values. It will be like:

enter image description here

0 Answers
Related