buglet in dist() ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

buglet in dist() ?

Ben Bolker-2

  the first line of dist() says

 if (!is.na(pmatch(method, "euclidian")))

  shouldn't that be "euclidean" ?

---------------------
R version 2.5.1 (2007-06-27)
i486-pc-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"    

other attached packages:
   bbmle     nlme
 "0.7.7" "3.1-84"

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: buglet in dist() ?

Peter Dalgaard
Ben Bolker wrote:
>   the first line of dist() says
>
>  if (!is.na(pmatch(method, "euclidian")))
>
>   shouldn't that be "euclidean" ?
>
>  
I think not.  The first *five* lines are

    if (!is.na(pmatch(method, "euclidian")))
        method <- "euclidean"
    METHODS <- c("euclidean", "maximum", "manhattan", "canberra",
        "binary", "minkowski")
    method <- pmatch(method, METHODS)

so what happens is that if you enter "euclidian" (which I gather is an
uncommon but valid spelling) you get the same result as with "euclidean".

> ---------------------
> R version 2.5.1 (2007-06-27)
> i486-pc-linux-gnu
>
> locale:
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
> [7] "base"    
>
> other attached packages:
>    bbmle     nlme
>  "0.7.7" "3.1-84"
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>  


--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: buglet in dist() ?

Ben Bolker-2
  oops.  sorry.  should have figured something
this obvious would have been on purpose.

  Ben


Peter Dalgaard wrote:

> Ben Bolker wrote:
>>   the first line of dist() says
>>
>>  if (!is.na(pmatch(method, "euclidian")))
>>
>>   shouldn't that be "euclidean" ?
>>
>>  
> I think not.  The first *five* lines are
>
>    if (!is.na(pmatch(method, "euclidian")))
>        method <- "euclidean"
>    METHODS <- c("euclidean", "maximum", "manhattan", "canberra",
>        "binary", "minkowski")
>    method <- pmatch(method, METHODS)
>
> so what happens is that if you enter "euclidian" (which I gather is an
> uncommon but valid spelling) you get the same result as with "euclidean".
>
>> ---------------------
>> R version 2.5.1 (2007-06-27)
>> i486-pc-linux-gnu
>>
>> locale:
>> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>>
>>
>> attached base packages:
>> [1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  
>> "methods" [7] "base"  
>> other attached packages:
>>    bbmle     nlme
>>  "0.7.7" "3.1-84"
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>  
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel