在包vignette中从GitHub安装R包

在包vignette中从GitHub安装R包,r,r-package,cran,R,R Package,Cran,我已经建立了一个R软件包,可以在CRAN上使用。我正在更新一个vignette,我想在vignette中安装一个来自GitHub的包。R CMD检查在我的机器上运行顺利,但在提交给CRAN后,我收到一条消息,指示我需要将包安装到临时库中 我使用此代码尝试将包安装到临时目录。代码在我的本地机器上工作,并且R CMD检查在本地通过(devtools::check()和devtools::check(remote=TRUE))。但在CRAN机器上运行时,检查失败(rhub::check_for_CRA

我已经建立了一个R软件包,可以在CRAN上使用。我正在更新一个vignette,我想在vignette中安装一个来自GitHub的包。R CMD检查在我的机器上运行顺利,但在提交给CRAN后,我收到一条消息,指示我需要将包安装到临时库中

我使用此代码尝试将包安装到临时目录。代码在我的本地机器上工作,并且R CMD检查在本地通过(
devtools::check()
devtools::check(remote=TRUE)
)。但在CRAN机器上运行时,检查失败(
rhub::check_for_CRAN()

#将临时路径添加到.libpath

您是否尝试过此邮件列表:
   ERROR: dependencies 'lazyeval', 'reshape2', 'scales', 'tibble' are not available for package 'ggplot2'
-  removing 'C:/Users/USERVzKWFkopnQ/AppData/Local/Temp/RtmpIjoZQH/working_dir/RtmpiwGvJu/gt_folder/ggplot2'
   ERROR: dependencies 'fansi', 'utf8', 'vctrs' are not available for package 'pillar'
-  removing 'C:/Users/USERVzKWFkopnQ/AppData/Local/Temp/RtmpIjoZQH/working_dir/RtmpiwGvJu/gt_folder/pillar'

   The downloaded source packages are in
    'C:\Users\USERVzKWFkopnQ\AppData\Local\Temp\RtmpIjoZQH\working_dir\RtmpiwGvJu\downloaded_packages'
   ERROR: dependencies 'checkmate', 'commonmark', 'dplyr', 'fs', 'ggplot2', 'sass', 'scales', 'tibble', 'tidyselect' are not available for package 'gt'
-  removing 'C:/Users/USERVzKWFkopnQ/AppData/Local/Temp/RtmpIjoZQH/working_dir/RtmpiwGvJu/gt_folder/gt'
   Quitting from lines 18-45 (install_from_github.Rmd) 
   Error: processing vignette 'install_from_github.Rmd' failed with diagnostics:
   there is no package called 'gt'
   --- failed re-building 'install_from_github.Rmd'

   SUMMARY: processing the following file failed:
     'install_from_github.Rmd'

   Error: Vignette re-building failed.
   Execution halted
Dear maintainer,

Pls see
<https://cran.r-project.org/web/checks/check_results_gtsummary.html>.

The check problems on the Debian systems are caused by attempts to write
to the user library to which all packages get installed before checking
(and which now is remounted read-only for checking).

Having package code which is run as part of the checks and attempts to
write to the user library violates the CRAN Policy's

  Packages should not write in the user’s home filespace (including
  clipboards), nor anywhere else on the file system apart from the R
  session’s temporary directory (or during installation in the location
  pointed to by TMPDIR: and such usage should be cleaned up).

In your case, you need to teach remotes::install_github("rstudio/gt") to
install to a temporary library and use it from there.