Learn R Programming

fields (version 1.7.2)

rdist.earth: Great circle distance matrix

Description

Given two sets of longitude/latitude locations computes the Great circle (geogrpahic) distance matrix among all pairings.

Usage

rdist.earth(loc1, loc2, miles = TRUE, R = NULL)

Arguments

Value

The great circle distance matrix if nrow(x1)=m and nrow( x2)=n then the returned matrix will be mXn.

Details

Surprisingly this all done efficiently in S.

See Also

rdist, exp.earth.cov

Examples

Run this code
out<- rdist.earth ( ozone$lon.lat)
#out is a 20X20 distance matrix

Run the code above in your browser using DataLab