<html><body><div style="color:#000; background-color:#fff; font-family:bookman old style, new york, times, serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1429380483124_2991"><span style="" class="" id="yui_3_16_0_1_1429380483124_3082">Pessoal estou tentando plotar um mapa por um  fator (X)  e por uma densidade (Y). O gráfico pela variável contínua (Y) está bom,  mas pela variável categórica (X)  dá os avisos, o gráfico não sai colorido e plota  preto e branco com </span><span style="" class="" id="yui_3_16_0_1_1429380483124_3082"><span style="" class="" id="yui_3_16_0_1_1429380483124_3082">aviso. </span> Já busquei na lista e no são google,  mas não consegui resolver. O arquivo é um  </span><span style="" class="" id="yui_3_16_0_1_1429380483124_3082">.shp do Mato Grosso que busquei no IBGE.</span></div><div id="yui_3_16_0_1_1429380483124_3151" dir="ltr"><span id="yui_3_16_0_1_1429380483124_3082">require(rgdal) <br style="" class="">mt=readOGR("51MUE250GC_SIR.shp",layer="51MUE250GC_SIR",encoding = "latin1")<br style="" class="">n <- nrow(mt@data)<br style="" class="">mt@data$Y <- rnorm(n)</span></div><div id="yui_3_16_0_1_1429380483124_3610" dir="ltr"><span id="yui_3_16_0_1_1429380483124_3082">head(mt@data)<br style="" class="">   ID CD_GEOCODM     NM_MUNICIP          Y X<br style="" class="">0 218    5100102       ACORIZAL -2.1099611 D<br style="" class="">1 219    5100201       ÁGUA BOA  0.9998267 D<br style="" class="">2 220    5100250  ALTA FLORESTA -0.7521304 D<br style="" class="">3 221    5100300  ALTO ARAGUAIA -1.5353345 B<br style="" class="">4 222    5100359 ALTO BOA VISTA  1.1464625 C<br style="" class="">5 223    5100409    ALTO GARÇAS -1.8388984 D<br style="" class="">spplot(mt,"Y")</span></div><div id="yui_3_16_0_1_1429380483124_3264" dir="ltr"><span id="yui_3_16_0_1_1429380483124_3082">mt@data$X <- sample(LETTERS[1:4], size = n, replace = T)</span></div><div id="yui_3_16_0_1_1429380483124_3380" dir="ltr"><b id="yui_3_16_0_1_1429380483124_3392"><span id="yui_3_16_0_1_1429380483124_3082">spplot(mt, "X", col.regions = heat.colors(4))</span></b></div><div id="yui_3_16_0_1_1429380483124_3381" dir="ltr"><span id="yui_3_16_0_1_1429380483124_3082">Houve 32 avisos (use warnings() para vê-los)</span></div><div id="yui_3_16_0_1_1429380483124_3207" dir="ltr">warnings()<br style="" class="">Mensagens de aviso:<br style="" class="">1: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">2: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">3: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">4: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">5: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">6: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">7: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">8: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">9: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">10: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">11: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">12: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">13: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">14: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">15: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">16: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">17: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">18: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">19: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">20: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">21: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">22: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">23: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">24: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">25: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">26: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">27: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">28: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">29: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">30: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br style="" class="">31: In Ops.factor(z, at[i]) : ‘>=’ não faz sentido para fatores<br style="" class="">32: In Ops.factor(z, at[i + 1]) : ‘<’ não faz sentido para fatores<br><span id="yui_3_16_0_1_1429380483124_3082"></span></div><div id="yui_3_16_0_1_1429380483124_3208" dir="ltr"><span id="yui_3_16_0_1_1429380483124_3082"></span></div><div id="yui_3_16_0_1_1429380483124_2993"><div id="yui_3_16_0_1_1429380483124_3457" dir="ltr">Alguém poderia me ajudar no erro? <br></div><div id="yui_3_16_0_1_1429380483124_3468" dir="ltr">obrigado <br></div><div id="yui_3_16_0_1_1429380483124_3482" dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div id="yui_3_16_0_1_1429380483124_3470" dir="ltr"><br></div></div><div id="yui_3_16_0_1_1429380483124_2995"><div id="yui_3_16_0_1_1429380483124_2994">
<br>
<br>André Oliveira Souza. 
<br>Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo.  IFES
<br>
<br></div></div></div></body></html>