From murdoch@stats.uwo.ca  Mon Nov  5 14:28:15 2001
From: murdoch@stats.uwo.ca (Duncan Murdoch)
Date: Mon, 05 Nov 2001 09:28:15 -0500
Subject: [Rd] Setting NA from C code
Message-ID: <g28duto96jem4p73ts0l2rubaeek0s52gs@4ax.com>

In the maps library, NA's are inserted between polygons so lines() can
be used to draw all polygons at once.  The code to do it is like this:

            *x++ = NA_REAL;
            *y++ = NA_REAL;

where x and y are declared as 

	double *x, *y, *range;

and are the arguments passed in through a .C call.

However, the values show up in R as -6.62314033633867e-229 instead of
NA, so the drawing gets messed up.

Any suggestions as to what might be going wrong?

This is happening in Windows, using gcc 2.95.2, R source 1.3.1,
platform i386-pc-mingw32.

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Setting NA from C code
Duncan Murdoch