<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EstiloDeEmail17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=PT-BR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Hi List.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I’m preparing a map for color
publication and some colleagues of mine which participate on this work, asked
me to put the bathymetric lines in a color ramp of deepness (eg.: light blue to
dark blue) just to create an didactic effect.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Well, this bathymetric data are stored in
SpatialLinesDataFrame Object imported from ShapeFiles with the readOGR (package
rgdal) function. Here is a summary of the object:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Object of class SpatialLinesDataFrame<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Coordinates:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> min max<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>r1 -53.01238 -26.92788<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>r2 -35.74499 7.03177<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Is projected: FALSE <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>proj4string :<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[+proj=longlat +ellps=WGS84 +datum=WGS84
+no_defs +towgs84=0,0,0]<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Data attributes:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> OBJECTID_1 OBJECTID COTA
<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Min. : 1 Min. : 1 Min.
: 25 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> 1st Qu.: 570 1st Qu.: 570 1st
Qu.: 850 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Median :1139 Median :1139 Median
:1900 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Mean :1139 Mean :1139 Mean
:2128 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> </span><span lang=FR>3rd Qu.:1708 3rd
Qu.:1708 3rd Qu.:3250 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR> </span><span lang=EN-US>Max. :2277 Max.
:2277 Max. :5750 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> SHAPE_Leng Shape_Le_1 LAYER
<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Min. : 0.04632 Min.
: 5079 4000 : 120 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> 1st Qu.: 0.35611 1st Qu.:
39116 3500 : 119 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Median : 0.61498 Median :
67435 3000 : 103 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Mean : 2.58294 Mean :
279864 3250 : 95 <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> </span>3rd Qu.: 1.13124 3rd
Qu.: 123223 3750 : 93 <o:p></o:p></p>
<p class=MsoNormal> Max. :123.74401 Max. :13320334 2500
: 89 <o:p></o:p></p>
<p class=MsoNormal> <span
lang=EN-US>(Other):1658<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Well I can plot it without any problem in a
map with other ShapeFiles (SpatialPolygonsDataFrame in this case) imported in
the same way. With the Polygons I’m able to color each item with the
color I want (eg.: col=c(‘col1’,’col2’,’etc’)),
but I’m not able to do so with the Lines object (neither with the col=c(‘col1’,’etc’)
or the col=c(colorRampPalette(c(‘initcol’,’endcol’))
function), when I try it the same way I did with the Polygons, only the first
specified color is applied to all lines and the others are ignored, if I try
with the colorRampPalette function nothing is plotted and I got a lot of
warnings (cor especificada não é nem numérica nem caracter == specified color
is not numeric neither character)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>So, here is the doubt, is there a way to designate
specific colors to each line of a SpatialLines* Object?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Ps.: I’m using the plot() function to
draw the maps (probably a specific panel variation of sp package).<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Thank you for your attention, I hope you
may help me.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>-------------------------------------------------------------<o:p></o:p></span></p>
<p class=MsoNormal><b><span style='font-size:8.0pt;font-family:"Tahoma","sans-serif"'>MSc.
<a href="mailto:r.aluizio@gmail.com"><span style='color:blue'>Rodrigo Aluizio</span></a><o:p></o:p></span></b></p>
<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Centro
de Estudos do Mar/UFPR</span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
</span><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Laboratório
de Micropaleontologia</span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
</span><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Avenida Beira
Mar s/n - CEP 83255-000</span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
</span><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif"'>Pontal
do Paraná - PR - Brasil</span><o:p></o:p></p>
</div>
</body>
</html>