I want to find out the euclidean distance of two matrices using the rdist()
function. It requires the fields package to be imported first. I am using R version 2.15.2 and unable to install this package as its giving error that package ‘fields’ is not available (for R version 2.15.2)
. Which package should I install?
Asked
Active
Viewed 482 times
0

sgibb
- 25,396
- 3
- 68
- 74

user2969490
- 135
- 1
- 1
- 5
2 Answers
0
You need to downlaod R version 3.0(or higher)
and fields package
also has dependencies - You also need to install spam
and maps
,
Depends: R (≥ 3.0), methods, spam, maps

Prasanna Nandakumar
- 4,295
- 34
- 63
-
thank you,but is there any function to calculate euclidean distance in this version of r? – user2969490 Dec 23 '13 at 19:47
-
http://stat.ethz.ch/R-manual/R-patched/library/stats/html/dist.html – Prasanna Nandakumar Dec 23 '13 at 19:55
-
1Upvote if your problem is solved – Prasanna Nandakumar Dec 23 '13 at 19:56
0
If you really don't want to use rdist
you could use dist
this is in stats and so part of base
dist(x, method = "euclidean")
e.g.
dist(rbind( c(1,2,3), c(3,2,1) ), method = "euclidean")
# this is the distance of the two vectors

user1317221_G
- 15,087
- 3
- 52
- 78