I saw an example of plot function in R, in which the "col" parameter had a value which was a variable rather than a colour value (eg. "blue","red" etc). For example in the example below, the col parameter points to variable "Region", and the graph shows Year in X axis and Sales in Y axis, with the points colored for Region (third dimension). I checked the documentation for plot function and also the color parameter, but there was no indication that the col parameter can take a variable name rather than colour values. I would like to understand whether I am looking at the right documentation.
year = c(1990:1994)
sales = c(1:5)
region = c('East','East','West','North','South')
SalesData = data.frame(sales,year,region)
with(SalesData,plot(year,sales,col=region))
?parand the sectionColor Specification. - nicola