From davidhughjones at gmail.com  Sat Mar  3 20:33:46 2018
From: davidhughjones at gmail.com (David Hugh-Jones)
Date: Sat, 3 Mar 2018 19:33:46 +0000
Subject: [Rd] install.packages doesn't produce warnings unless qualified
 with utils::
Message-ID: <CAARY7kgJNpGOB1HhTzVWVFnwwh-AH=r8Ke7678XPM-snpp99xA@mail.gmail.com>

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.

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

Any ideas?
Cheers,
David

	[[alternative HTML version deleted]]



[Rd] install.packages doesn't produce warnings unless qualified with utils::
David Hugh-Jones