hi I am trying to personalize the colors of the geom_line() graph but every time I add the aes(color = 'green','blue') argument my graph becomes one straight vertical line with two colors (not green and blue but the default blue and red labelled green and blue)
my data is esentially two insurance groups and I am comparing their rates of coverage through a certain time period.
ggplot(data = mydata aes(x = group, y = rate, group = insurance)) + geom_line(aes(color = insurance)) + geom_point()
If you want to set the colors, you don't do that in the aes() function. That function is for setting the relationship between the values in the data and features on the plot. You can set the colors manually with the function scale_color_manual(). Here is a simple example.
If colours need to be set, this must be done manually scale_color_manual(). Here, this is not done via the aes() function, as this serves a completely different purpose, namely to enable us and allow us to set any relationships between the features created in the graph and the values that have been added in them.