我正在尝试在另一个不同Mclust()
的mclust
包中使用包中的函数。
但是,似乎Mclust()
需要包中的另一个函数 ,mclustBIC
才能mclust
工作:
mod1 = mclust::Mclust(iris[,1:4])
#> Error in mclustBIC(data = structure(c(5.1, 4.9, 4.7, 4.6, 5, 5.4, 4.6, : could not find function "mclustBIC"
summary(mod1)
#> Error in summary(mod1): object 'mod1' not found
首先加载包会导致以下工作:
library(mclust)
#> Package 'mclust' version 5.3
#> Type 'citation("mclust")' for citing this R package in publications.
mod1 = mclust::Mclust(iris[,1:4])
summary(mod1)
#> ----------------------------------------------------
#> Gaussian finite mixture model fitted by EM algorithm
#> ----------------------------------------------------
#>
#> Mclust VEV (ellipsoidal, equal shape) model with 2 components:
#>
#> log.likelihood n df BIC ICL
#> -215.726 150 26 -561.7285 -561.7289
#>
#> Clustering table:
#> 1 2
#> 50 100
但我不清楚如何在包中执行此操作。
在我的包中,我尝试添加@importFrom mclust mclustBIC
到 Roxygen 文档中,但这不起作用。
所以,我的问题是:如何使用或导入我尝试使用的功能似乎需要的这个功能?