[R-sig-Geo] shapefiles plotting and colouring

Christophe Declercq cdeclercq at nordnet.fr
Fri Oct 31 17:40:36 CET 2003


Hi, Paolo

> De : r-sig-geo-bounces at stat.math.ethz.ch
> [mailto:r-sig-geo-bounces at stat.math.ethz.ch]De la part de Paolo
> Cavallini
> Envoyé : vendredi 31 octobre 2003 14:57
> À : r-sig-geo at stat.math.ethz.ch
> Objet : [R-sig-Geo] shapefiles plotting and colouring

[...]
> Hi all.
> it may be a silly question

Not silly at all...

> it may be a silly question, but: how can I, after reading a
> shapefile with the
> appropriate library, draw them with different colours (or grey shades)
> according to different database fields (read through RODBC)? The idea is
> similar to the polygon command, but using shp as polygons and
> database fields
> as qualifiers.

In the 'maptools' package, you have the 'plot.Map' function (see ?plot.Map
and the 'auxvar', 'type' and 'nclass' arguments).

If you convert from a 'Map' object to a 'polylist' object with the
'Map2poly' function, you can also use 'plotpolys' which is more flexible.

Have a look at the ?plotpolys example, and by the way, try also the
'RColorBrewer' package for beautiful and efficient colors.

Hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail c.declercq at orsnpdc.org

> Thanks for any suggestions.
> Ciao.
> paolo
> - --
> Paolo Cavallini
> cavallini at faunalia.it
> www.faunalia.it
> Piazza Garibaldi 5
> 56025 Pontedera (PI)
> Italy
> Tel: (+39)348-3801953
> GPG signature/firma digitale @:
> www.faunalia.it/Public_key_Paolo.asc

[...]




More information about the R-sig-Geo mailing list