Dear R help-list,
I am trying to calculate Monmoniers algorithm. I have 3 data sets: coordinates
(coord), distance matrix (comdist) and geographical distance matrix (geodist). I
consistently get the error " dimnames does not match array extent".
However, when I use the function "structure" I get the following
results:
> str(coord)
'data.frame': 114 obs. of 3 variables:
$ sites : Factor w/ 114 levels "beni.bl","beni.pen",..: 1 2
3 4 5 6 7 8 9 10 ...
$ xcoord: num 2.16 1.35 9.01 9.72 9.83 ...
$ ycoord: num 6.92 11.02 5.24 4.81 5 ...> str(comdist)
Class 'dist' atomic [1:6441] 0.00 2.74e-05 5.58e-01 3.65e-01 6.03e-03
...
..- attr(*, "Labels")= chr [1:114] "beni.bl"
"beni.pen" "came.kor" "came.kup" ...
..- attr(*, "Size")= int 114
..- attr(*, "call")= language as.dist.default(m = com, diag = TRUE,
upper = TRUE)
..- attr(*, "Diag")= logi TRUE
..- attr(*, "Upper")= logi TRUE> str(geodist)
Class 'dist' atomic [1:6441] 4.18 7.05 7.84 7.91 8.02 ...
..- attr(*, "Labels")= chr [1:114] "beni.bl"
"beni.pen" "came.kor" "came.kup" ...
..- attr(*, "Size")= int 114
..- attr(*, "call")= language as.dist.default(m = geo, diag = TRUE,
upper = TRUE)
..- attr(*, "Diag")= logi TRUE
..- attr(*, "Upper")= logi TRUE
The label names are exactly identical. Any hint what causes the error and how to
avoid it?
Any help is highly appreciated!
best wishes
Johannes
[[alternative HTML version deleted]]