Hi all,
anyone has an idea how I could fix this?
\donttest{
## Set colors from colorspace package with a fallback
col <- try(colorspace::rainbow_hcl(5), silent = TRUE) %||% rainbow(5)
}
The problem is that this makes R CMD check freak out
(http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/falsy-00check.html)
if the colorspace package is not declared as a dependency. But the
point of the example is to define a meaningful behavior when
colorspace is missing.... so I don't really want to put this into
\dontrun{}...
I vaguely remember that there was also \dontcheck{}, but it is not in
'Writing R extensions', so probably I cannot use it. Or can I? I am
not even sure what the difference is between \donttest and
\dontcheck....
Thanks,
Gabor
On Mon, Dec 8, 2014 at 7:38 AM, Prof Brian Ripley <ripley at
stats.ox.ac.uk> wrote:> This concerns packages using \donttest in their examples. Such code
> will be run by example() and hence should be runnable ... yours is
> not.
>
> One issue showing is that the examples use undeclared packages: this
> is showing on the CRAN check pages for packages
>
> Distance GLDreg RECA TreePar complmrob disposables egcm enigma
> extrafont falsy ggplot2 imputeYn investr lava prodlim randomForestSRC
> rbison separationplot shiny smoother vcdExtra
>
> With R-devel the \donttest examples can be run by R CMD check
> --run-donttest: we have done that and found failures in packages most
> of those above, plus
>
> BNSP DCGL EIAdata ExtDist FeedbackTS FlexParamCurve IsoGene MGLM
> MsatAllele PRISMA RSurvey RandomFields ReporteRs Rmpi Rssa TR8 VarEff
> aoristic breakage dplyr effects ftsa geocodeHERE ggHorizon ggmap
> ggtern gvcm.cat hyperSpec knitcitation knitr mboost mets mfblock
> mobForest mra nontarget npRmpi nullabor openNLP parfm plsRbeta powerr
> pxweb rcrossref rgbif rsnps season spMC spgwr spocc taxize timereg
> toaster
>
> and warnings in DSpat
>
> In almost all cases there is something obviously wrong with the
> failing example.
>
> Please submit an update to CRAN (using the webform, and following the
> CRAN policies at http://cran.r-project.org/web/packages/policies.html).
> Do NOT reply to this email to submit an update!
>
> There may be other issues that need fixing shown on the package's
> results page.
On 08/12/2014 9:40 AM, G?bor Cs?rdi wrote:> Hi all, > > anyone has an idea how I could fix this? > > \donttest{ > ## Set colors from colorspace package with a fallback > col <- try(colorspace::rainbow_hcl(5), silent = TRUE) %||% rainbow(5) > } > > The problem is that this makes R CMD check freak out > (http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/falsy-00check.html) > if the colorspace package is not declared as a dependency. But the > point of the example is to define a meaningful behavior when > colorspace is missing.... so I don't really want to put this into > \dontrun{}...Why not declare colorspace as a "Suggests:" kind of dependency? Duncan Murdoch> > I vaguely remember that there was also \dontcheck{}, but it is not in > 'Writing R extensions', so probably I cannot use it. Or can I? I am > not even sure what the difference is between \donttest and > \dontcheck.... > > Thanks, > Gabor > > > > On Mon, Dec 8, 2014 at 7:38 AM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: > > This concerns packages using \donttest in their examples. Such code > > will be run by example() and hence should be runnable ... yours is > > not. > > > > One issue showing is that the examples use undeclared packages: this > > is showing on the CRAN check pages for packages > > > > Distance GLDreg RECA TreePar complmrob disposables egcm enigma > > extrafont falsy ggplot2 imputeYn investr lava prodlim randomForestSRC > > rbison separationplot shiny smoother vcdExtra > > > > With R-devel the \donttest examples can be run by R CMD check > > --run-donttest: we have done that and found failures in packages most > > of those above, plus > > > > BNSP DCGL EIAdata ExtDist FeedbackTS FlexParamCurve IsoGene MGLM > > MsatAllele PRISMA RSurvey RandomFields ReporteRs Rmpi Rssa TR8 VarEff > > aoristic breakage dplyr effects ftsa geocodeHERE ggHorizon ggmap > > ggtern gvcm.cat hyperSpec knitcitation knitr mboost mets mfblock > > mobForest mra nontarget npRmpi nullabor openNLP parfm plsRbeta powerr > > pxweb rcrossref rgbif rsnps season spMC spgwr spocc taxize timereg > > toaster > > > > and warnings in DSpat > > > > In almost all cases there is something obviously wrong with the > > failing example. > > > > Please submit an update to CRAN (using the webform, and following the > > CRAN policies at http://cran.r-project.org/web/packages/policies.html). > > Do NOT reply to this email to submit an update! > > > > There may be other issues that need fixing shown on the package's > > results page. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
On Mon, Dec 8, 2014 at 3:32 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: [...]> Why not declare colorspace as a "Suggests:" kind of dependency?I guess that is a solution. :/ In another example in the 'disposables' package I have: \donttest{ pkg <- make_packages( foo1 = { f <- function() print("hello!") ; d <- 1:10 }, foo2 = { f <- function() print("hello again!") ; d <- 11:20 } ) foo1::f() foo2::f() foo1::d foo2::d dispose_packages(pkg) } So in this case should I suggest 'foo1' and 'foo2'? Gabor [...]