[Rd] Small change to plot.xy
Prof Brian D Ripley
ripley@stats.ox.ac.uk
Mon, 25 Nov 2002 11:20:58 +0000 (GMT Standard Time)
The problem is that col= is interpreted in C code for many different R
functions, not kust those going through plot.xy. The only consistent way I
see to handle this is to change the common C code to handle more cases, if
people really think it is worth complicating R for.
I was going to point out that your previous solution was less general than
what was there at present.
On Mon, 25 Nov 2002, Jonathan Rougier wrote:
> Hi Thomas,
>
> Thomas Lumley wrote:
> >
> > On Sat, 23 Nov 2002, Jonathan Rougier wrote:
> >
> > > OK -- so there are two objections to the proposal:
> > >
> > > 1) The factor might be a colour specifier
> > >
> >
> > The function below might help
> > It checks:
> > - are the levels colour names
> > - are they numbers
> > - are they color specifiers like #a0f3d2
> > otherwise it returns the underlying codes with unclass().
>
> Is there a case, given that colours *can* be represented in several
> different ways, for including the two functions "is.color" and
> "as.color" in the base? I imagine the latter would work like
> "as.numeric", putting NA for elements that cannot be coerced to
> colours. The function "as.color" might return a specific colour format,
> perhaps #hhhhhh if that is the most general, which would simplify other
> parts of the code.
>
> Jonathan.
>
> --
> Jonathan Rougier Science Laboratories
> Department of Mathematical Sciences South Road
> University of Durham Durham DH1 3LE
> tel: +44 (0)191 374 2361, fax: +44 (0)191 374 7388
> http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-devel
>
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595