<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:8pt"><div><span>Valeu Éder. Vou ver oq e você sugeriu. Muito obrigado!!!<br><br></span></div><div></div><div> </div><div>Tenho uma outra pergunta, o terraview, usa escala de cores par mostrar essas quantidades. Como controlar isso no R?. </div><div><br></div><div> </div><div>[ ]'s.</div><div>Edson Lira<br>Estatístico<br>Manaus-Amazonas</div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: verdana, helvetica, sans-serif; font-size: 8pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> Em Sexta-feira, 23 de Maio de 2014 13:17, Éder Comunello <comunello.eder@gmail.com> escreveu:<br> </font> </div> <br><br> <div
class="y_msg_container"><div id="yiv6522922476"><div><div dir="ltr"><div>Edson, boa tarde!</div><div><br clear="none"></div><div>Acredito que você deveria usar um "mapa de zonas" no lugar do "mapa de BAIRROS". </div><div><br clear="none"></div><div>No link que segue estão os arquivos (shapefile) para uso no script (ao final):</div>
<div><a rel="nofollow" shape="rect" target="_blank" href="http://dl.dropbox.com/s/5dpo1ad1oez2752/manausZon.zip">http://dl.dropbox.com/s/5dpo1ad1oez2752/manausZon.zip</a><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div><img src="http://dl.dropbox.com/s/t0fcp0ezl3g6ajf/mapa_manaus1.png" width="471.99999999999994" height="471.99999999999994"><br clear="none">
<div class="yiv6522922476gmail_extra"><span style="font-family: 'courier new', monospace;">### <code r></span><br clear="none"></div><div class="yiv6522922476gmail_extra"><div><font face="courier new, monospace"># rm(list=ls())</font></div><div><font face="courier new, monospace">library(maptools)</font></div>
<div><font face="courier new, monospace">setwd(choose.dir());getwd() ### defina o diretório de trabalho</font></div><div><font face="courier new, monospace"><br clear="none"></font></div><div><font face="courier new, monospace">mapZonas <- readShapePoly("manausZon.shp")</font></div>
<div><font face="courier new, monospace">mapZonas@data</font></div><div><font face="courier new, monospace"><br clear="none"></font></div><div><font face="courier new, monospace">{plot(mapZonas, col=heat.colors(8), axes=T)</font></div>
<div><font face="courier new, monospace">with(mapZonas@data, text(X1, X2, ZONAS, cex=.5))</font></div><div><font face="courier new, monospace">title("Manaus - Zonas")}</font></div><div><font face="courier new, monospace"><br clear="none">
</font></div><div><font face="courier new, monospace">apAll <- read.csv2("doa_apto_00_12.csv"); names(apAll)</font></div><div><font face="courier new, monospace">ap2011 <- subset(apAll, TRUE, select = c("ZONAS", "ano2011")); ap2011</font></div>
<div><font face="courier new, monospace"><br clear="none"></font></div><div><font face="courier new, monospace">dados <- merge(mapZonas@data, ap2011)</font></div><div><font face="courier new, monospace">mapZonas@data <- dados</font></div>
<div><font face="courier new, monospace"><br clear="none"></font></div><div><font face="courier new, monospace">quant <- quantile(dados$ano2011, include.lowest=TRUE); quant</font></div><div><font face="courier new, monospace">breaks <- c(floor(quant[-length(quant)]/10), ceiling(quant[length(quant)]/10))*10; breaks</font></div>
<div><font face="courier new, monospace">dcut <- cut(dados$ano2011, breaks, right=F, dig.lab=4); dcut</font></div><div><font face="courier new, monospace">levels(dcut)</font></div><div><font face="courier new, monospace"><br clear="none">
</font></div><div><font face="courier new, monospace">cores <- c("#779999", "#99BBBB", "#BBDDDD", "#DDFFFF") ### cores <- palette()</font></div><div><font face="courier new, monospace"># cores <- rev(heat.colors(4))</font></div>
<div><font face="courier new, monospace"><br clear="none"></font></div><div><font face="courier new, monospace"># x11()</font></div><div><font face="courier new, monospace">plot(mapZonas, axes=T, col=cores[dcut])</font></div><div><font face="courier new, monospace">legend(legend=levels(dcut), "topright", bty="n", fill=cores, cex=.8)</font></div>
<div><font face="courier new, monospace">title("Doações aptas em Manaus por zona \n 2011")</font></div><div><font face="courier new, monospace"># with(mapZonas@data, text(X1, X2, ZONAS, cex=.5)) text(X1, X2, ZONAS, cex=.5))</font></div>
<div><font face="courier new, monospace">tmp <- with(mapZonas@data, paste(ZONAS, '\n', ano2011))</font></div><div><font face="courier new, monospace">with(mapZonas@data, text(X1, X2, tmp, cex=.5))</font></div><div>
<font face="courier new, monospace"><br clear="none"></font></div><div><font face="courier new, monospace">### </code></font></div></div><div class="yiv6522922476yqt9039687937" id="yiv6522922476yqtfd02015"><div class="yiv6522922476gmail_extra"><br clear="none"></div><div class="yiv6522922476gmail_extra"><br clear="none"></div><div class="yiv6522922476gmail_extra">
<br clear="all"><div><div dir="ltr">Éder Comunello <<a rel="nofollow" shape="rect" ymailto="mailto:comunello.eder@gmail.com" target="_blank" href="mailto:comunello.eder@gmail.com">c</a><a rel="nofollow" shape="rect" ymailto="mailto:omunello.eder@gmail.com" target="_blank" href="mailto:omunello.eder@gmail.com">omunello.eder@gmail.com</a>> <br clear="none">Dourados, MS - [22 16.5'S, 54 49'W]<br clear="none">
</div></div>
<br clear="none"><br clear="none"></div><div class="yiv6522922476gmail_extra"><br clear="none"></div><div class="yiv6522922476gmail_extra"><br clear="none"></div></div></div></div></div><br><br></div> </div> </div> </div> </div></body></html>