使用自写程序包部署Shiny应用程序 [英] Deploying a Shiny app using a self-written package
问题描述
我有一个正常工作的闪亮应用程序,它使用library(coral),其中珊瑚是我自己写的一个包,安装在该闪亮应用程序的目录中.
I have a working shiny app which uses library(coral), where coral is a package I wrote myself, installed in the directory of the shiny app.
当我尝试将应用程序部署到Shinyapps.io上时,收到以下消息:
When I attempt to deploy my app onto shinyapps.io, I receive the following message:
Error: Unable to retrieve package records for the following packages:
- "coral"
Execution halted
根据我在网上可以收集到的信息,问题可能出在CRAN上没有珊瑚,因此Shinyapps.io无法从那里获取该软件包的记录.
From what I can gather online, the issue is probably that coral is not on CRAN, so shinyapps.io cannot get the records for that package from there.
这是对问题的正确描述吗?有没有简单的解决方案?
Is that a correct description of the problem? And is there a simple solution?
谢谢.
推荐答案
shinyapps.io具有devtools
软件包,
它可以从GitHub安装软件包,
如果您不介意将包裹放在这里:
shinyapps.io has the devtools
package,
and it can install packages from GitHub,
if you don't mind putting your package there:
library(devtools)
devtools::install_github("youruser/yourpackage")
devtools
也具有其他功能,可以从其他来源安装,
例如,来自bitbucket的install_bitbucket()
,来自任意URL的install_url()
和来自磁盘上本地文件的install_file()
.
devtools
has other functions too to install from other sources,
for example install_bitbucket()
from bitbucket, install_url()
from an arbitrary url and install_file()
from a local file on disk.
要从本地目录安装,可以使用install
:
To install from a local directory, you can use install
:
devtools::install('path/to/r/package/dir')
这篇关于使用自写程序包部署Shiny应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!