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

Daniel Sjoberg d@n|e|d@@joberg @end|ng |rom gm@||@com
Mon Nov 11 18:44:19 CET 2019


Thank you Ben. That is a great suggestion.  While searching for
instructions on using pre-compiled vignettes, I came across a few posts
recommending the dependency package be stored in a drat repository on
GitHub and using the DESCRIPTION `Additional_repositories:` tag to point to
it.  This solution seems easier in my current workflow, so I am going to
give that a try first.  But if the same problems persist, I am absolutely
moving to pre-complied vignettes.

Thank you,
Daniel Sjoberg

On Sun, Nov 10, 2019 at 5:40 PM Ben Bolker <bbolker using gmail.com> wrote:

>
>  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
> >
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list