Skip to content
Prev 8470 / 63421 Next

Small change to plot.xy

Hi everyone,

Is there any reason why we should not automatically coerce a factor
supplied as an argument to col in a plotting function?  The following
modification (to R-1.6.1) seems pretty harmless
function (xy, type, pch = 1, lty = "solid", col = par("fg"), 
    bg = NA, cex = 1, ...) 
{
    if (is.factor(col)) 
        col <- codes(col)
    .Internal(plot.xy(xy, type, pch, lty, col, bg, cex, ...))
}
<environment: namespace:base>

and I think it is natural and not really wrong to want to type, say,
and get the colours.

Cheers, Jonathan.