I have a much larger dataframe
but I post here a tow example for reproducibility.
df = data.frame(fc_col = c(rep('apple',3),rep('orange',3),rep('banana',3)),var1 = c(rep(1:3,3)),var2 = c(20,10,5,30,15,2,40,27,8))
If I plot:
> ggplot(data=df, aes(x=var1, y=var2,colour = fc_col))+
+ geom_line()
I get this:
I would like to get something like apple
to black and banana
orange
to a single color say blue. Imagine there are not 3 levels of factor fc_col
like in this case but 300. I would also like to get rid of the label banana
orange
and write a single one say fruits
and have it there with the blue color as mentioned.