Pessoal,<div><br></div><div>tenho alguns pontos num shapefile e preciso saber as distâncias entre todos os pontos.</div><div>Consegui fazer isso utilizando spDists mas a matriz que resulta não identifica os pontos pela coluna de atributo que eu preciso, apresenta apenas uma matriz quadrada utilizando 1,1; 1,2...2,1;2,2...e etc pra definir as linhas e as colunas e eu preciso que ao invés de 1,1 apareçam os atributos de uma coluna específica. Isso seria possível??</div>
<div>Além disso, qual unidade é utilizada nas distancias?Km?metros?</div><div><br></div><div>O codigo eh o seguinte:</div><div><br></div><div><div>rm(list=ls(all=TRUE))</div><div>library(base)</div><div>library(maps)</div>
<div>library(sp)</div><div>library(maptools)         </div><div>library(spdep)      </div><div>library(classInt)    </div><div>library(RColorBrewer) </div><div>library(shape)</div><div>library(SDMTools)</div><div>library(latticeExtra)</div>
<div>pontos = readShapePoints("c:/users/Julianna/Documents/SecSaude/hospitais_produtividade.shp")</div><div>proj4string(pontos) <- CRS("+init=epsg:4291")</div><div>distancias = spDists(pontos)</div>
</div><div> </div><div>Resultando:</div><div><br><span class="Apple-style-span" style="border-collapse:separate;font-family:Arial;border-spacing:0px;font-size:medium"><span class="Apple-style-span" style="font-family:'Segoe UI';font-size:12px"><table class="GJWPQFQDHS" cellspacing="0" cellpadding="2" style="border-collapse:collapse;width:643px">
<tbody><tr class="GJWPQFQDJS GJWPQFQDNS" style="line-height:1.2;font-size:10pt!important"><td style="font-family:'Lucida Console';border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,239,242);border-right-color:rgb(238,239,242);border-bottom-color:rgb(238,239,242);border-left-color:rgb(238,239,242);line-height:1.4;font-size:10pt!important">
pontos</td><td style="font-family:'Lucida Console';border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,239,242);border-right-color:rgb(238,239,242);border-bottom-color:rgb(238,239,242);border-left-color:rgb(238,239,242);line-height:1.4;font-size:10pt!important">
SpatialPointsDataFrame[1]</td></tr></tbody></table></span></span><div><span class="Apple-style-span" style="border-collapse:separate;font-family:Arial;border-spacing:0px;font-size:medium"><span class="Apple-style-span" style="font-family:'Segoe UI';font-size:12px"><table class="GJWPQFQDHS" cellspacing="0" cellpadding="2" style="border-collapse:collapse;width:643px">
<tbody><tr class="GJWPQFQDJS GJWPQFQDNS GJWPQFQDIS" style="line-height:1.2;font-size:10pt!important"><td style="font-family:'Lucida Console';border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,239,242);border-right-color:rgb(238,239,242);border-bottom-color:rgb(238,239,242);border-left-color:rgb(238,239,242);line-height:1.4;font-size:10pt!important">
distancias</td><td style="font-family:'Lucida Console';border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,239,242);border-right-color:rgb(238,239,242);border-bottom-color:rgb(238,239,242);border-left-color:rgb(238,239,242);line-height:1.4;font-size:10pt!important;height:15px;width:19px;overflow-x:hidden;overflow-y:hidden;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAPCAYAAAAGRPQsAAACCklEQVR42pWT3U4TQRiGN6YaPZFwRSYeewHegwl34InR+IMSFYOSAhahQRpaUrUGQSi0lnZLtZa2VuKJv9ltu7vt7na3fwev30wXIzAHdJM3+8238z6Zd2ZHqlS+XSqXD+Ri8SsKhS/I58vIfSxCzhawm8kjmcphO5HFZjyN9fcpxNZ2sqHI28uSJJ2Rjj+l0oGSUh1k6l1ktIFkT3xM/TRTrYNdUvjzT4SjGypZz58AFvYr3JD44yChOEgqLj6oLn8nacz6279txH9Z2PphYuN7E8vhdyDrRZLvCOxTvgSKOpSCyzEGGyWdOwLby+2j1+/Dbrl8otvuot3p8dpxO9Rv87phtqAbFjTNRGAxKoalaZM5zB7AHIIxIKtbzn+wpk0wE3WtCX8gIoax0xo25tOZkBgW35HR6/VhWg6faFHcw8gWrfawbzQoom6iVm/g8bMlMYz9O91un2K0uImZTXsAaJoOadDXaL9YxFrdwMSTRTEstpYYOub4o3kxLPpmCx06PRaBTdQpDjs1XuvWvz6LV60ZUFQDtyeei2Erq+v8pNhEbqI3M7K66gFYrVR1KIoGea+Em+MzYtjcfOTKwtJrNRB8hdkXq5ieW8GUP4TJ6Zd4OBXEg8kF3KNYd2g1t+7P4sZdf/Xa2PWrZB0hnT1+Pdn9uuB9HD2lRjzPycvuNX3esk8jnwj0FxmWfBHVS8ESAAAAAElFTkSuQmCC');background-color:initial;background-repeat:no-repeat no-repeat">
23x23 double matrix</td></tr></tbody></table></span></span></div><div><br></div>-- <br>Julianna Trindade <br><br>"Exalta-te, Senhor, na Tua força! Nós cantaremos e louvaremos o Teu poder."<br><br>Salmos 21; 13<br>

</div>