当我尝试安装并调用Amelia库时,遇到以下问题(我首先尝试安装失败,然后尝试像此代码中那样放置缺少的依赖项)
> remove.packages('Amelia')
Removing package from ‘C:/Users/----/anaconda3/envs/rstudio/lib/R/library’
(as ‘lib’ is unspecified)
> install.packages('foreign', dependencies = TRUE)
Warning in install.packages :
package ‘foreign’ is not available (for R version 3.6.1)
> install.packages('Zelig', dependencies = TRUE)
Warning in install.packages :
package ‘Zelig’ is not available (for R version 3.6.1)
> install.packages('Amelia', dependencies = TRUE)
Warning in install.packages :
dependencies ‘foreign’, ‘Zelig’ are not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/Amelia_1.7.6.zip'
Content type 'application/zip' length 1828511 bytes (1.7 MB)
downloaded 1.7 MB
package ‘Amelia’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\hytte\AppData\Local\Temp\RtmpElko04\downloaded_packages
然后,当我调用库并调用函数missmap时:
library(Amelia)
Error: package or namespace load failed for ‘Amelia’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
aucun package nommé ‘foreign’ n'est trouvé
In addition: Warning message:
le package ‘Amelia’ a été compilé avec la version R 3.6.3
> missmap(df.train)
Error in missmap(df.train) : could not find function "missmap"