[R-pkg-devel] Install Package from GitHub in Vignette

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Sun Nov 10 23:32:25 CET 2019


 I don't know the particular answer to your question, but perhaps an
alternative way to go about this is to wrap the code in your vignette
that depends on this package in an if (requireNamespace("gt")) {} clause
(and perhaps supply pre-compiled versions of the vignette in the doc/
directory)? (And supply clear directions in the text of your vignette
for how users can install the package if they want it.)

  Ben Bolker

On 2019-11-10 3:39 p.m., Daniel Sjoberg wrote:
> There is a package only available on GitHub that prints beautiful tables.
> I list this package in the `Enhances:` section of my package's DESCRIPTION
> file.  I would like to show the use of this enhancement in a vignette.  I
> use the code below in a vignette to install the package to a temporary
> folder and add that folder to `.libPaths`.
> 
> I run checks locally, Travis CI, Appveyor, win-devel, RHub, and everything
> looks fine.  The updated package was accepted earlier today, but a few hour
> later I received the email below.  It appears on the Solaris build a
> package dependency of the RStudio {gt} package is attempting to install
> (the sass package), although the package is already available on the
> machine.  I suspect it is related to installing the {gt} package to a
> temporary folder?
> 
> Any tips how to install the package from GitHub without violating any CRAN
> policies?
> 
> Thank you!
> 
> Email received from CRAN:
> See https://cran.r-project.org/web/checks/check_results_gtsummary.html .
> 
> This attempts to install a package, and fails because it does not
> respect that package's SystemRequirements.  Here:
> 
> if (curl::has_internet()) {
>    # adding tmpdir to libPath
>    temp_path <- file.path(tempdir(), "gt_folder")
>    dir.create(temp_path)
>    lib_path <-.libPaths()
>    .libPaths(c(lib_path, temp_path))
> 
>    # installing gt
>    remotes::install_github("rstudio/gt", lib = temp_path)
> }
> 
> which apparently also attempts to install sass.
> 
> Why?  Packages should be making use of already installed packages (sass
> is installed on that system, but may need to be declared).
> 
> Please correct ASAP and before Nov 17 to retain the package on CRAN.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



More information about the R-package-devel mailing list