gf_point - Color according to groups

Hello R Community!

I am currently writing my bachelors thesis and I have a question regarding the gf_point function. My study is about sales success in investment consulting and I conducted an experiment with four groups of advisors. In the exploratory data analysis I therefore try to plot a graph about the interplay between amount of investment and the customers┬┤ wealth. The plot looks fine, but I would like to color the points according to the advisor groups. For example, the points of group one should be blue, group 2 green, ...

My formula for the attached plot is:

gf_point(investment ~ wealth, data = record) %>%
        gf_lm(investment ~ wealth, data = record)

Could you tell me how I can color the points according to the groups? The variable is named "heuristic". Many thanks in advance!

Best regards

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.