[Rd] R_ColorTable

Prof Brian D Ripley ripley@stats.ox.ac.uk
Wed, 4 Oct 2000 07:35:34 +0100 (BST)

On Wed, 4 Oct 2000, Nicholas Lewin-Koh wrote:

> Hi, In C code called from .Call using the R interface, is it possible to
> access the variables R_ColorTable and R_ColorTableSize? I tried 
> extern int R_ColorTableSize; 
> extern unsigned int R_ColorTable[]; 
> extern char *DefaultPalette[]; 
> as in Graphics.h but I guess that code doesn't get written into libR ? But
> I can access 
> extern void hsv2rgb
> which is in graphics.c
> Any help?

Are you doing this on Windows (you don't seem to say)?  If so the comment
in the Makefile

# R.dll exports all global symbols BUT import library (libR.a)
# only (all functions) + (global vars listed in exported-vars))

should answer your problem (add them to a local copy of R.exp and remake
libR.a).  The rationale was to avoid namespace pollution, as you will
need to remake globalvars.h and include that too.  exported-vars should
include all the variables in the public API.

I should point out that Graphics.h (it is capitalized) is not a distributed
header and not supported for use in addons.  We've had discussions about
changing some of that.

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

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch