One way to do it is to use the "col" argument in the plot() function. If you create a column in your dataset that represents the different groups as the numbers 1, 2, 3, 4, then you can say 'col = my_data$groups' in the plot function and the points will be colored based on each group. The different numbers represent different colors. Hope that helps!
Very fruitful sir.
I have different categories. How do I colour the different groups? I've got 4 groups. Helpppp :(
One way to do it is to use the "col" argument in the plot() function. If you create a column in your dataset that represents the different groups as the numbers 1, 2, 3, 4, then you can say 'col = my_data$groups' in the plot function and the points will be colored based on each group. The different numbers represent different colors. Hope that helps!