[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Unittest of oligoClasses tries to write data to /usr/local/lib/R/site-library



On 19 March 2021 at 17:42, Benilton Carvalho wrote:
| Thank you,

My pleasure, and sorry that I didn't get to the debian-r folder for a few days.

Also:

| On Fri, Mar 19, 2021, 5:38 PM Dirk Eddelbuettel <edd@debian.org> wrote:
| > A fairly standard way around this is to make the package a Suggests: and to
| > condition the use in code (or tests) via
| >
| >    if (requireNamespace(pkageNameHere, quietly = TRUE) {

Lacks a second ) as usual, I often type that wrong...

| >       ....
| >    }
| >
| > That method is described in Writing R Extensions too, and followed by a
| > (very) large nunber of packages.

Here is an example from RcppArmadillo which only needs and uses Matrix to
create some sparse matrices for tests. If Matrix were not present, the test
exists at line 20.

https://sources.debian.org/src/r-cran-rcpparmadillo/0.10.2.2.0-1/inst/tinytest/test_sparse.R/

(This used to use RUnit, but I moved most of my packages to tinytest, and
recently talked about tinytest at the BioConductor Developer Forum if you're
curious, there is now a video in the BioC YouTube channel).

Best, Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd@debian.org


Reply to: