Learn R Programming

pgirmess (version 2.0.2)

findR: Computes the distance between the centroid and the most distant coordinate of a geographical coordinate set

Description

Computes the distance between the centroid and the most distant coordinate of a geographical coordinate set.

Usage

findR(coords)

Value

The distance

Arguments

coords

A matrix or data frame of 2 columns of geographical coordinates

See Also

polycirc

Examples

Run this code

mydata<-cbind(x=rnorm(20),y=rnorm(20))
radius<-findR(mydata)
centroid<-matrix(colMeans(mydata),ncol=2)
plot(mydata,asp=1)
points(centroid,pch=19,col="red",cex=2)
polygon(polycirc(radius,centroid),border="red")

Run the code above in your browser using DataLab