我必须将Shiny应用程序部署到已在其上运行应用程序的Shiny Server上,并且此sevrer使用旧的R版本,即版本3.4.0(2017)。服务器上已经安装了许多软件包,每个软件包都有给定的版本。
要部署我的应用程序,我必须确保开发的应用程序仍可与此版本的R和已安装的软件包版本一起使用。 (我知道处理此类问题的一种干净方法是使用packrat,但是我不能在这里使用它,因为我只能将文件拖放到sevrer上,而不能在服务器中打开R来运行packrat: :restore()和packrat :: on())
为此,我已经在计算机上安装了R 3.4.0,现在我想安装代码所需的所有软件包,但要使用与闪亮的服务器环境匹配的版本。对于许多软件包,相应的版本不是CRAN中的最新版本。
我知道可以使用devtools软件包的功能install_version
安装软件包的给定版本。问题是我无法安装devtools。当我运行install.packages("devtools")
时,将显示:
also installing the dependencies ‘colorspace’, ‘vctrs’, ‘munsell’, ‘lifecycle’, ‘pillar’, ‘sourcetools’, ‘gtable’, ‘reshape2’, ‘scales’, ‘tibble’, ‘lazyeval’, ‘shiny’, ‘ggplot2’, ‘askpass’, ‘clisymbols’, ‘gh’, ‘purrr’, ‘rprojroot’, ‘yaml’, ‘processx’, ‘fansi’, ‘htmlwidgets’, ‘crosstalk’, ‘openssl’, ‘brew’, ‘commonmark’, ‘stringr’, ‘xml2’, ‘praise’, ‘usethis’, ‘callr’, ‘cli’, ‘covr’, ‘desc’, ‘DT’, ‘ellipsis’, ‘glue’, ‘git2r’, ‘httr’, ‘pkgbuild’, ‘pkgload’, ‘rcmdcheck’, ‘roxygen2’, ‘rversions’, ‘testthat’
There are binary versions available but the source versions are later:
binary source needs_compilation
vctrs 0.1.0 0.2.3 TRUE
pillar 1.3.1 1.4.3 FALSE
scales 1.0.0 1.1.0 TRUE
tibble 2.1.1 2.1.3 TRUE
shiny 1.3.2 1.4.0 FALSE
ggplot2 3.1.1 3.2.1 FALSE
gh 1.0.1 1.1.0 FALSE
purrr 0.3.2 0.3.3 TRUE
yaml 2.2.0 2.2.1 TRUE
processx 3.3.0 3.4.2 TRUE
fansi 0.4.0 0.4.1 TRUE
htmlwidgets 1.3 1.5.1 FALSE
openssl 1.3 1.4.1 TRUE
xml2 1.2.0 1.2.2 TRUE
usethis 1.5.0 1.5.1 FALSE
callr 3.2.0 3.4.2 FALSE
cli 1.1.0 2.0.2 FALSE
covr 3.2.1 3.4.0 TRUE
DT 0.5 0.12 FALSE
ellipsis 0.1.0 0.3.0 TRUE
git2r 0.25.2 0.26.1 TRUE
httr 1.4.0 1.4.1 FALSE
pkgbuild 1.0.3 1.0.6 FALSE
rcmdcheck 1.3.1 1.3.3 FALSE
roxygen2 6.1.1 7.0.2 TRUE
rversions 1.1.0 2.0.1 FALSE
testthat 2.1.1 2.3.2 TRUE
devtools 2.0.2 2.2.2 FALSE
Do you want to install from sources the packages which need compilation?
y/n:
无论我选择是还是否,控制台上都印有很多内容,但是当我尝试加载程序包时,它最终不起作用:
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
有人可以告诉我另一种在R 3.4.0中安装devtools的方法,以便我可以用我需要的版本加载所有其他软件包吗?
谢谢:)