[R-pkg-devel] "try" malfunctions on Ubuntu Linux 16.04 LTS, R-release, GCC

Iñaki Ucar |uc@r @end|ng |rom |edor@project@org
Mon Feb 3 10:06:12 CET 2020


On Mon, 3 Feb 2020 at 03:16, Spencer Graves
<spencer.graves using effectivedefense.org> wrote:
>
> Hello, All:
>
>
>        devtools::check_rhub failed to trap an error wrapped in "try",
> per the email below.  This came from running
> devtools::check_rhub(Ecfun_dir), where Ecfun_dir = the path to a copy of
> "https://github.com/sbgraves237/Ecfun".

That's improbable.

>        This is the development version of Ecfun, which I want to submit
> to CRAN as soon as I can do so without offending the sensibilities of
> the overworked CRAN maintainers.
>
>
>        Suggestions?
>        Thanks,
>        Spencer Graves
>
>
> -------- Forwarded Message --------
> Subject:        Ecfun 0.2-2: ERROR
> Date:   Sun, 02 Feb 2020 23:27:10 +0000
> From:   R-hub builder <support using rhub.io>
> To:     spencer.graves using effectivedefense.org
>

<snip>

> > ## 2.9.  A more complicated example with elements to eval
> > ##
> > logo.jpg <- paste(R.home(), "doc", "html", "logo.jpg",
> +                   sep = .Platform$file.sep)
> > if(require(jpeg)){
> +   Rlogo <- try(readJPEG(logo.jpg))
> +   if(!inherits(Rlogo, 'try-error')){
> + # argument list for a call to rasterImage or rasterImageAdj
> +     RlogoLoc <- list(image=Rlogo,
> +       xleft.0 = c(NZ=176.5,CH=172,US=171,
> +                   CN=177,RU= 9.5,UK= 8),
> +       xleft.1 = c(NZ=176.5,CH=  9,US=-73.5,
> +                   CN=125,RU= 37, UK= 2),
> +       ybottom.0=c(NZ=-37,  CH=-34,US=-34,
> +                   CN=-33,RU= 48, UK=47),
> +       ybottom.1=c(NZ=-37,  CH= 47,US= 46,
> +                   CN= 32,RU=55.6,UK=55),
> +       xright=quote(xleft+xinch(0.6)),
> +       ytop = quote(ybottom+yinch(0.6)),
> +       angle.0 =0,
> +       angle.1 =c(NZ=0,CH=3*360,US=5*360,
> +                  CN=2*360,RU=360,UK=360)
> +     )
> +
> +     RlogoInterp <- interpPairs(RlogoLoc,
> +             .proportion=rep(c(0, -1), c(2, 4)) )
> + # check
> + ## Don't show:
> + stopifnot(
> + ## End(Don't show)
> + all.equal(names(RlogoInterp),
> +    c('image', 'xright', 'ytop', 'xleft', 'ybottom', 'angle'))
> + ## Don't show:
> + )
> + ## End(Don't show)
> + }
> + # NOTE:  'xleft', and 'ybottom' were created in interpPairs,
> + # and therefore come after 'xright' and 'ytop', which were
> + # already there.
> +
> + ##
> + ## 2.10.  using envir
> + ##
> +   RlogoDiag <- list(x0=quote(Rlogo.$xleft),
> +                   y0=quote(Rlogo.$ybottom),
> +                   x1=quote(Rlogo.$xright),
> +                   y1=quote(Rlogo.$ytop) )
> +
> +   RlogoD <- interpPairs(RlogoDiag, .p=1,
> +                     envir=list(Rlogo.=RlogoInterp) )
> + ## Don't show:
> + stopifnot(
> + ## End(Don't show)
> + all.equal(RlogoD, RlogoDiag)
> + ## Don't show:
> + )
> + ## End(Don't show)
> + }
> Loading required package: jpeg
> Error in readJPEG(logo.jpg) : unable to open /usr/lib/R/doc/html/logo.jpg
> Error in interpPairs.list(RlogoDiag, .p = 1, envir = list(Rlogo. = RlogoInterp)) :
>    object 'RlogoInterp' not found
> Calls: interpPairs -> interpPairs.list
> Execution halted

There it is: "Error in interpPairs.list [...] 'RlogoInterp' not
found". That's the error, not the "try". You see the error message
because you didn't specify "quiet=TRUE", but that doesn't mean that R
is failing to catch the error. So the second error is the one that
fails.

Iñaki



More information about the R-package-devel mailing list