I am trying to plot an R graph with data points coloured by a factor. I am using the property col with values from a data frame column as the factor, but they seem not to be recognised correctly.
My code is as follows:
plot(marrmales$tot_nochc, xlab="", ylab="Tot hours worked", col=marmales.df$cor_partner, pch=15)
marmales.df$cor_partner is a vector of 0 and 1.
When I plot this, only data points for which the cor_partner value is 1 are shown. If I specify colours (I thought 0 might be read as NULL and return white), all data points are shown, but in the first of the specified colours.
I have tried converting cor_partner to characters, but nothing changed.
Anyone knows what is happening? Thanks