0

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?

sgibb
  • 25,396
  • 3
  • 68
  • 74
user2969490
  • 135
  • 1
  • 1
  • 5

2 Answers2

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
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