此问题靠近以下站点:
R - Importing 'xlsx' package to my own package doesn't work
我在安装良好的某些计算机上制作了一个名为aa
的软件包。
当我尝试在另一台计算机上安装自己的软件包时,会出现以下错误消息:
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source aa
* installing to library 'C:/Users/aaaaaaaaaaa/Documents/R/win-library/3.5'
ERROR: dependencies 'knitr', 'rstan', 'readxl', 'testdat', 'openxlsx', 'xlsx', 'gridExtra' are not available for package 'aa'
* removing 'C:/Users/aaaaaaaaaaa/Documents/R/win-library/3.5/aa'
In R CMD INSTALL
Exited with status 1.
亲手安装了以上错误中描述的软件包knitr
之后,错误消息如下,软件包knitr
从中消失:
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source aa
* installing to library 'C:/Users/aaaaaaaaaaa/Documents/R/win-library/3.5'
ERROR: dependencies 'rstan', 'readxl', 'testdat', 'openxlsx', 'xlsx', 'gridExtra' are not available for package 'aa'
* removing 'C:/Users/aaaaaaaaaaa/Documents/R/win-library/3.5/aa'
In R CMD INSTALL
Exited with status 1.
我想知道的是我自己的软件包中使用的软件包是否自动安装。
答案 0 :(得分:1)
也许您可以尝试这样更简单的方法:
在您的func pball() -> [Int] {
return (1...69).shuffled()[...4].sorted() + [.random(in: 1...26)]
}
文件中添加以下代码
.R
或
tryCatch({
library(knitr)
}, error = function(e) {
install.packages("knitr")
library(knitr)
})