Hi,
Is it possible to access to the C source code of the "dist" function?
I
mean when u do read the dist code, it points almost directly to a C
function :
d <- .C("R_distance", x = as.double(x), nr = N, nc = ncol(x),
d = double(N * (N - 1)/2), diag = as.integer(FALSE),
method = as.integer(method), p = as.double(p), DUP = FALSE,
NAOK = TRUE, PACKAGE = "stats")$d
I would like to access to the R_distance.c in order to add a home made
distance for classification distance.
Thanks for your help, Guillaume
you can access "distance.c" in R-sources in the directory
\src\library\stats\src
I hope it helps.
Best,
Dimitris
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
----- Original Message -----
From: "Guillaume Allain" <guillaume.allain at cbconseil.com>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, June 20, 2005 11:28 AM
Subject: [R] [interfacing C][dist]
> Hi,
>
> Is it possible to access to the C source code of the "dist"
> function? I
> mean when u do read the dist code, it points almost directly to a C
> function :
>
> d <- .C("R_distance", x = as.double(x), nr = N, nc = ncol(x),
> d = double(N * (N - 1)/2), diag = as.integer(FALSE),
> method = as.integer(method), p = as.double(p), DUP = FALSE,
> NAOK = TRUE, PACKAGE = "stats")$d
>
> I would like to access to the R_distance.c in order to add a home
> made
> distance for classification distance.
>
> Thanks for your help, Guillaume
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
On Mon, 20 Jun 2005, Guillaume Allain wrote: Either download the source code and unpack the file you need, or use the online anonymous SVN facility: https://svn.r-project.org/R/trunk/src/library/stats/src/distance.c> Hi, > > Is it possible to access to the C source code of the "dist" function? I > mean when u do read the dist code, it points almost directly to a C > function : > > d <- .C("R_distance", x = as.double(x), nr = N, nc = ncol(x), > d = double(N * (N - 1)/2), diag = as.integer(FALSE), > method = as.integer(method), p = as.double(p), DUP = FALSE, > NAOK = TRUE, PACKAGE = "stats")$d > > I would like to access to the R_distance.c in order to add a home made > distance for classification distance. > > Thanks for your help, Guillaume > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no