Error-에러: 객체 'print.lm'를 찾을 수 없습니다

CODEDRAGON Development/Big Data, R, ...

반응형


 

오류메시지

에러: 객체 'print.lm'를 찾을 수 없습니다

> print

function (x, ...)

UseMethod("print")

<bytecode: 0x0000000016f83890>

<environment: namespace:base>

> print.lm

에러: 객체 'print.lm' 찾을 없습니다

>

 

 

오류원인

stats패키지 안에 있는 내부 함수( internal function)를 그냥 호출할 경우 발생하게 됩니다. 이 함수는 트리플연산자(:::)를 통해서 접근가능합니다.

 

 

 

해결방법 

triple operator(:::) 사용하여 접근합니다. 그러면 lm오브젝트의 print컴포넌트를 확인할 수 있습니다.

> stats:::print.lm

function (x, digits = max(3L, getOption("digits") - 3L), ...)

{

    cat("\nCall:\n", paste(deparse(x$call), sep = "\n", collapse = "\n"),

        "\n\n", sep = "")

    if (length(coef(x))) {

        cat("Coefficients:\n")

        print.default(format(coef(x), digits = digits), print.gap = 2L,

            quote = FALSE)

    }

    else cat("No coefficients\n")

    cat("\n")

    invisible(x)

}

<bytecode: 0x000000000cebbc00>

<environment: namespace:stats>

>

 

 

반응형