Skip to content
Prev 167356 / 398502 Next

Where to find the source codes for the internal function in stats package

Murray Cooper wrote:
... which suggests that either you lack stamina or the ability to use 
search tools. It's not all that hard.

Anyways, the .Internal functions are dispatched via the table in 
src/main/names.c, in this case to do_modelmatrix in src/main/model.c

[pd at titmouse2 R]$ find -name \*.c | xargs grep 'model\.matrix'
./src/main/model.c:	    warning(_("problem with term %d in model.matrix: 
no columns are assigned"),
./src/main/names.c:{"model.matrix",do_modelmatrix,	0,	11,	2, 
{PP_FUNCALL, PREC_FN,	0}},

[pd at titmouse2 R]$ find -name \*.c | xargs grep 'do_modelmatrix'
./src/main/model.c:	/* and is ultimately called by do_modelmatrix. */
./src/main/model.c:SEXP attribute_hidden do_modelmatrix(SEXP call, SEXP 
op, SEXP args, SEXP rho)
./src/main/names.c:{"model.matrix",do_modelmatrix,	0,	11,	2, 
{PP_FUNCALL, PREC_FN,	0}},