From josh.m.ulrich at gmail.com  Sat Mar  3 21:00:54 2018
From: josh.m.ulrich at gmail.com (Joshua Ulrich)
Date: Sat, 3 Mar 2018 14:00:54 -0600
Subject: [Rd] install.packages doesn't produce warnings unless qualified
 with utils::
In-Reply-To: <CAARY7kgJNpGOB1HhTzVWVFnwwh-AH=r8Ke7678XPM-snpp99xA@mail.gmail.com>
References: <CAARY7kgJNpGOB1HhTzVWVFnwwh-AH=r8Ke7678XPM-snpp99xA@mail.gmail.com>
Message-ID: <CAPPM_gRzeLntvQm6NQLLasaJuR2pLU89Z4qwpuMX9uy0Y5218A@mail.gmail.com>

On Sat, Mar 3, 2018 at 1:33 PM, David Hugh-Jones
<davidhughjones at gmail.com> wrote:
> Hi all,
>
> Assuming this is an R core issue:
>
> tryCatch(install.packages("clipr", repos = "bullshit"), warning = function
> (w) cat("got a warning"))
> Warning in install.packages :
>   unable to access index for repository bullshit/src/contrib:
>   cannot open URL 'bullshit/src/contrib/PACKAGES'
> Warning in install.packages :
>   package ?clipr? is not available (for R version 3.4.3)
> Warning in install.packages :
>   unable to access index for repository
> bullshit/bin/macosx/el-capitan/contrib/3.4:
>   cannot open URL 'bullshit/bin/macosx/el-capitan/contrib/3.4/PACKAGES'
>
> In other words, lots of warnings, but none are caught.
>
Using R-3.4.3 on 64-bit Ubuntu throws and catches the warning.

R> tryCatch(install.packages("clipr", repos="w"), warning=function(w)
cat("got a warning!\n"))
Installing package into '/home/josh/R/library'
(as 'lib' is unspecified)
got a warning!

> It works if you use the fully qualified version in utils:
>
> tryCatch(utils::install.packages("clipr", repos = "bullshit"), warning =
> function (w) cat("got a warning"))
> got a warning
>
My guess is that something (a package, console, etc) is masking
utils::install.packages().

> Any ideas?
> Cheers,
> David
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2018 | www.rinfinance.com



[Rd] install.packages doesn't produce warnings unless qualified with utils::
Joshua Ulrich