Hi,
I am reading the source code of rpart. I have problems understand the following
code and would appreciate for any helps. In rpart.s, there is a line:
rpfit <- .C(C_s_to_rp,
n = as.integer(nobs),
nvarx =
as.integer(nvar),
ncat =
as.integer(cats* !isord),
method=
as.integer(method.int),
as.double(unlist(controls)),
parms =
as.double(unlist(init$parms)),
as.integer(xval),
as.integer(xgroups),
as.double(t(init$y)),
as.double(X),
as.integer(!is.finite(X)), # R lets Infs through
error = character(1),
wt = as.double(wt),
as.integer(init$numy),
as.double(cost),
NAOK=TRUE)
Is this line calling the rpart.c function? If so, what was sent to rpfit? I am
confused because rpart.c only returns an integer, not an object. The following
is the rpart.c function:
int rpart(int n, int nvarx, Sint *ncat, int method, int
maxpri, double *parms, double *ymat, FLOAT *xmat, Sint
*missmat, struct cptable *cptable, struct node
**tree, char
**error, int *which, int xvals, Sint
*x_grp, double *wt, double *opt, int
ny, double *cost)
----------------------
Thanks!
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.