FW: [STATSGRASS] Questions on calculating minimum distance between polygons and map attributes after m.in.e00

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FW: [STATSGRASS] Questions on calculating minimum distance between polygons and map attributes after m.in.e00

Kristian Skrede Gleditsch
Just to clarify my previous post: For contiguous countries the distance at
the boundary will be 0, but this is not the case for non-contiguous
countries.

For example, I have estinated a minimum distance between Germany and Italy
of about 175 km. For the UK and China it would clearly be more than 1000 km.
Although this could be measured by hand, finding a good estimate of the
shortest distance is increasingly more difficult the further appart the two
states are.

sincerely,

Kristian Skrede Gleditsch
Assistant Professor
Department of Political Science
University of California, San Diego
La Jolla, CA 92093-0521, USA
Tel: (858) 822 0535, Fax: (858) 534 7130
Email: kgleditsch at ucsd.edu  http://weber.ucsd.edu/~kgledits/

> -----Original Message-----
> From: Rich Shepard [mailto:rshepard at appl-ecosys.com]
> Sent: Thursday, November 20, 2003 16:58
> To: Kristian Skrede Gleditsch
> Subject: Re: [STATSGRASS] Questions on calculating minimum distance
> between polygons and map attributes after m.in.e00
>
>
> On Thu, 20 Nov 2003, Kristian Skrede Gleditsch wrote:
>
> > I have a research project for which I would like to find the minimum
> > distance between nation states.
>
> Kristian,
>
>   Wouldn't this distance be 0 (zero) at the border between them?
>
> Rich
>
> --
> Dr. Richard B. Shepard, President
> Applied Ecosystem Services, Inc. (TM)
> <http://www.appl-ecosys.com>
>
>



Reply | Threaded
Open this post in threaded view
|

numeric(0) ?????

Massimiliano Cannata
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20031202/973a3c99/attachment.pl>

Reply | Threaded
Open this post in threaded view
|

numeric(0) ?????

Ole F. Christensen
Dear Massimiliano


How about

for (i in 1:20){
if(any(T$pluto==i)) T$pippo[T$pluto==i]
}

??

Depending on what you want to do with these subsets of the data.frame,
you might want to consider using
``tapply'' or ``by'' [se the help-files for these functions] instead of
the for loop.

For example :

tapply(T$pluto,T$pippo, sum)

Cheers

Ole


Massimiliano Cannata wrote:

>hello,
>I have a little problem with my script:
>
>I select a subset from a data frame
>
>for (i in 1:20){
>T$pippo[T$pluto==i]
>}
>
>but sometime it is void because T$pluto==5 does not exists, the R answer is:
>
>T$pippo[T$pluto==5]
>  
>
>>numeric(0)
>>    
>>
>
>how to exclude this null subset?
>and what is numeric(0), similar to NA?
>I try an if statement, but how to write if T$pippo[T$pluto==i] is numeric(0)???
>
>Thanks a lot.
>Maxi
>
>
>-------------
>Ing.  Massimiliano Cannata
>Istituto di Scienze della Terra - SUPSI
>C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
>Tel +41 91 /935 12 25 - Fax +41 91 /935 12 09
>eMail: massimiliano.cannata at supsi.ch
>Internet: http://www.ist.supsi.ch
>
>
> [[alternative HTML version deleted]]
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at stat.math.ethz.ch
>https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>  
>

--
Ole F. Christensen
Center for Bioinformatik
Datalogisk Institut
Aarhus Universitet
Ny Munkegade, Bygning 540
8000 Aarhus C
Denmark