简体   繁体   English

R gamlss::predict.gamlss 不是从 'namespace:gamlss' 导出的 object

[英]R gamlss::predict.gamlss not an exported object from 'namespace:gamlss'

I am experiencing some confusing behavior from gamlss in R.我在 R 中遇到了来自gamlss的一些令人困惑的行为。 The documentation lists predict.gamlss and ?predict.gamlss returns the function documentation in RStudio.文档列表 predict.gamlss 和?predict.gamlss predict.gamlss 在 RStudio 中返回 function 文档。 However, the function does not autocomplete when typing out predict.gamlss , and trying to run it returns Error: 'predict.gamlss' is not an exported object from 'namespace:gamlss' .但是,function 在输入predict.gamlss时不会自动完成,并且尝试运行它会返回Error: 'predict.gamlss' is not an exported object from 'namespace:gamlss' How does that happen?这是怎么发生的? Is the function deactivated somehow? function 是否以某种方式停用? There is a separate function predictAll that does work.有一个单独的 function predictAll确实有效。

The documentation does state该文档确实 state

This function is under development此 function 正在开发中

I am trying to access the function because I am experiencing some confusing results with predict and predictAll .我正在尝试访问 function 因为我遇到了predictpredictAll的一些令人困惑的结果。

R version is 4.0.0. R 版本为 4.0.0。 gamlss version is 5.1.6. gamlss版本是 5.1.6。

As far as I can tell, what you describe is expected and is normal S3 method dispatching.据我所知,您所描述的是预期的并且是正常的 S3 方法调度。 The method predict.gamlss is called when you call predict on a object of class gamlss .当您在 class gamlss 的predict.gamlss上调用predict时,会调用方法gamlss

Consider the following (from the documentation of ?predict.gamlss )考虑以下内容(来自?predict.gamlss的文档)

data(abdom)
aa <- gamlss(y ~ cs(x^.5), data = abdom)
#[1] 371.3931
predict(aa)[610]

Looking at the class of aa :查看aa的 class :

class(aa)
#[1] "gamlss" "gam"    "glm"    "lm"   

The function is not exported, but the S3 method is registered. function没有导出,但是注册了S3方法。

As to the difference between predictAll and predict.gamlss , you'll have to read the documentation (the two are documented together).至于predictAllpredict.gamlss之间的区别,您必须阅读文档(两者一起记录)。 My guess is that predictAll predict all listed in the what -argument of predict.gamlss .我的猜测是predictAll预测所有在 predict.gamlss 的what predict.gamlss中列出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM