Entering edit mode
8.4 years ago
james.lloyd
▴
100
I have a dataframe in R and I want to plot a subset of the plot as a line graph in ggplot. I have 8 different variables, with no guarantee all 8 will appear in the subset I want to plot. How can I for ggplot to assign variable A to a particular color code #B35806 and H to #542788? I tried to assign this to the dataframe itself (a column where if A is present, #B35806 would be) and calling on that in ggplot but that did not help
geom_line(aes(color=Line_color))
Advice would be very useful to this R noob.