[R] Using earth.dist function
cmartin
fireweed44 at shaw.ca
Tue Feb 21 19:42:18 CET 2012
Hi Everyone,
I am a graduate student who will be using R to do my analysis. I need to do
a spatial analysis, and the first step is to calculate the geographic
distance between my study sites. I am hoping to use earth.dist because it
allows for multiple pairwise distances to be calculated at one time. I have
done a sample calculation, and I seem to have a problem between the steps of
using create.lats and earth.dist. I've copied the steps I've taken in R
since I am NOT computer literate and have a real problem debugging computer
programming. Hopefully someone can help.
> create.lats(weatherstations,loc="locality",long="longitude",lat="latitude")
longitude latitude
Adra -119.58 49.73
Bankier Chain Lake -120.28 49.70
Chute Lake -119.53 49.68
Douglas Lake -120.20 50.16
Hedley -120.08 49.36
Hedley NP Mine -120.02 49.37
> data(weatherstations.lats)
Warning message:
In data(weatherstations.lats) : data set ‘weatherstations.lats’ not found
> earth.dist(weatherstations.lats)
Error in earth.dist(weatherstations.lats) :
object 'weatherstations.lats' not found
> earth.dist(weatherstations)
1 2 3 4 5
2 NA
3 NA NA
4 NA NA NA
5 NA NA NA NA
6 NA NA NA NA NA
There were 50 or more warnings (use warnings() to see the first 50)
>
Thanks! Cloe
--
View this message in context: http://r.789695.n4.nabble.com/Using-earth-dist-function-tp4407892p4407892.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list