回复 第2楼 的 channingyuri:原来需要根据参数的类型来查看predict
“The form of the value returned by predict depends on the class of its argument.”
你推荐的methods(predict)很有用。我找到了需要查看的函数代码。谢谢!
此外,我在网页上还找到如下方法显示各种的predict。不过这种方法代码太多。
require(utils)
## All the "predict" methods found
## NB most of the methods in the standard packages are hidden.
for(fn in methods("predict"))
try({
f <- eval(substitute(getAnywhere(fn)$objs[[1]], list(fn = fn)))
cat(fn, ":\n\t", deparse(args(f)), "\n")
}, silent = TRUE)