Gray and black dots appear in the plot in relation to female (gray) and black (male). The col argument specifies color based on gender type. However, the bracket syntax looks to be randomly thrown in the col argument. Where can this be found as i was unable to find it in the documentation?
plot(surveyNA$Height ~ surveyNA$Wr.Hnd, col = c("gray", "black")[as.numeric(surveyNA$Sex)], pch = 16, xlab = "Writing handspan", ylab= "Height")