Pergunta

I am trying to view the source code of the function knnreg in caret.

> getAnywhere(knnreg.default)
A single object matching ‘knnreg.default’ was found
It was found in the following places
  package:caret
  registered S3 method for knnreg from namespace caret
  namespace:caret
with value

function (x, ...) 
{
    if (!any(class(x) %in% "formula")) 
        stop("knnreg only implemented for formula objects")
}
<environment: namespace:caret>

What's happening? Where is the source code?

Foi útil?

Solução

I think the error message is pretty obvious:

knnreg only implemented for formula objects

Use getAnywhere(knnreg.formula) to see the source code.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top