I am trying to create a scatter plot, I would like the plot points to have colors based on one of my database variables (continent). Below is the database and code so you can correct me. I also want that numbers do not appear in the labels but the name determined by the variable (country). The objective is to do the simulation and so far it works for me but when appending the two lines before the plot, it stops working.
Beforehand thank you very much. Cheers!
Apparently your graph looks black due to the overlapping of the points, which seems to me to have a black outline, and since there are so many, it looks like this. I would recommend you to make that graph with the library
ggplot2
since in a way it is more comfortable to read than the base graph package of R.If you rule out using ggplot, I would recommend that you change the
pch
to one that has no outline and also adjust the plot opacity.Here an example with ggplot2
On the other hand, always try to share code in text format, not in an image.
Ctrl + C
andCtrl + V
he is the best friend of those who want to help you in stackoverflow