Skip to content

Data for use in maps()

1 message · White.Denis@epamail.epa.gov

#
regarding
EDA
what
lack
Dear Millo Giovanni:

Attached is a zip file containing three files.  The file
'italy.prov.pol'
is a R/Splus format polygon file of the provinces.  In this file, there
are NA records in the $y column where the polygons end.  The
corresponding
$x column are polygon identifiers.

The file 'italy.prov.pat' has three columns: the first are the polygon
identifiers used in 'italy.prov.pol', the second are the NUTS3
identifiers,
and the third are the names.  The file 'italy.prov.crf' has commas
separating the fields.

The file italy.prov.e00 is an arc/info export file of a polygon coverage
of the province boundaries.  This was extracted from the European NUTS3
file of third level political boundaries available at:
http://www.grid.unep.ch/data/grid/gnv159.php.  The R/S format files
above
were made from this arc/info file.

All location coordinates in the above files are geographic
(longitude, latitude).

In Becker and Wilks document "Constructing a Geographical Database" that
accompanies the 'maps' package there is a description of how to make a
database that can be used by the maps package.  I am not aware that
anyone
has made this capability available in R, and I have not done this
either.

You can read the .pol file like this:

prov <- read.table ("italy.prov.pol", header=TRUE)

You can then use this function:

plot.map <- function (x, y) {
  rx <- range (x[!is.na(y)], na.rm=TRUE)
  ry <- range (y[!is.na(x)], na.rm=TRUE)
  plot.new ()
  plot.window (rx, ry, asp=1)
  }

and say

plot.map (prov$x, prov$y)
polygon (prov)

You can read the .pat file like this:

pat <- read.table ("italy.prov.pat", sep=",", header=TRUE, quote="")

With this file you can connect the polygon boundaries in the .pol file
with names in .pat and with your statistics.  There is a crude mapping
facility available in contributed package "maptree".

Best wishes,

Denis White
   US EPA, 200 SW 35th St, Corvallis, Oregon, 97333 USA
   voice: 541.754.4476, email: white.denis at epa.gov
   web: www.epa.gov/wed/pages/staff/white/


< attachment deleted>