R软件包创建:如何自动安装丢失的软件包?

时间:2019-09-04 13:09:23

标签: shinydashboard r-package

我正在尝试使用devtools创建自己的闪亮包(我们称其为XX),但是我有一个问题:当我加载该包(库(XX))并调用用于启动Shiny App的函数时,一切没关系。但是,当我删除程序包(remove.packages(“ XX”))时,请删除UI所需的程序包shinydashboard((remove.packages(“ shinydashboard”))并安装程序包(带有程序包存档文件) ),出现错误:

ERROR: dependency 'shinydashboard' is not available for package 'shinypackage'
* removing 'C:/user1/Documents/R/win-library/3.6/shinypackage'
Warning in install.packages :
  installation of package ‘C:/user1/Documents/Applications_Shiny/shinypackage_0.0.0.9000.tar.gz’ had non-zero exit status

我了解它来自我删除的库shinydashboard,但我不知道如何使丢失的软件包自动安装,而不是像在解决saim问题的某些响应中所看到的那样手动安装

这是我的 DESCRIPTION FILE (描述文件):

Package: shinypackage
Title: Package Shiny
Version: 0.0.0.9000
Authors@R: person("FirstName", "LastName", email = "user1@email.com", role = c("aut", "cre"))
Description: This is a description.
Depends: 
    R (>= 3.5.0),
    shiny,
    shinydashboard,
    shinyWidgets,
    stringr,
    dplyr,
    tidyr
License: file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
Imports: 
    shiny,
    shinydashboard,
    shinyWidgets,
    stringr,
    dplyr,
    tidyr

有人可以解决我的问题吗? :)

0 个答案:

没有答案