Displaying 2 results from an estimated 2 matches for "r_canberra".
Did you mean:
canberra
2001 Mar 05
1
Canberra dist and double zeros
...be
possible to have this kind of feature in R as well?
It seems that this would do the trick without breaking applications where
double zeros do not occur:
--- R-1.2.2/src/appl/distance.c Sun Oct 15 18:13:25 2000
+++ R-work/src/appl/distance.c Mon Mar 5 10:16:53 2001
@@ -93,5 +93,5 @@
double R_canberra(double *x, int nr, int nc, int i1, int i2)
{
- double dist;
+ double dist, sum;
int count, j;
@@ -100,5 +100,7 @@
for(j=0 ; j<nc ; j++) {
if(R_FINITE(x[i1]) && R_FINITE(x[i2])) {
- dist += fabs(x[i1] - x[i2])/fabs(x[i1] + x[i2]);
+ sum = fabs(x[i1] + x[i2]);...
2001 Mar 05
1
Canberra dist and double zeros
...be
possible to have this kind of feature in R as well?
It seems that this would do the trick without breaking applications where
double zeros do not occur:
--- R-1.2.2/src/appl/distance.c Sun Oct 15 18:13:25 2000
+++ R-work/src/appl/distance.c Mon Mar 5 10:16:53 2001
@@ -93,5 +93,5 @@
double R_canberra(double *x, int nr, int nc, int i1, int i2)
{
- double dist;
+ double dist, sum;
int count, j;
@@ -100,5 +100,7 @@
for(j=0 ; j<nc ; j++) {
if(R_FINITE(x[i1]) && R_FINITE(x[i2])) {
- dist += fabs(x[i1] - x[i2])/fabs(x[i1] + x[i2]);
+ sum = fabs(x[i1] + x[i2]);...