prlab
On 20 Jan 1998 09:02:56 -0600, Douglas Bates wrote:
Andreas Weingessel <Andreas.Weingessel@ci.tuwien.ac.at> writes:
When I tried to port the statlib-Pkg rpart to R, I came across the c-Function prlab which seems to be part of S+, but not of R. Does anyone know what prlab does and how difficult it would be to emulate it in R?
Can you show us the context? If I had to guess I would say it was a routine to print labels but that's just a guess.
That seems right, the function is called labels.rpart and seems to be
similar to the S-Fct labels.tree.
The call itself is
pn <- .C("prlab",
lab = character(2 * length(var)),
as.character(splits[, 1]),
as.character(splits[, 2]),
as.character(unlist(xlevels)),
as.integer(var2), #with 0 denoting a leaf
as.integer(temp),
as.integer(length(var2)))
where (for the data I tried) var is a vector of factor objects, splits
is an nx2 matrix of strings, xlevels is NULL, var2 and temp are
numeric vectors.
Of course I can send the whole code, if someone is interested.
Andreas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._