Skip to content
Prev 52533 / 63424 Next

improve 'package not installed' load errors?

On 24/10/2016 1:51 PM, Kevin Ushey wrote:
I think one way to get here is to be running with several libraries.  
You install ggplot2 while Rcpp is available, but in a different part of 
the .libPaths list, then in a later session try to use it with a 
different .libPaths setting.
The risk with this message is that Rcpp may really be installed, but 
it's just not currently on .libPaths.  Detecting that situation and 
reporting on it looks like it would be relatively hard:  it would mean 
the ggplot2 installation needs to record where it found all 
dependencies, and if at some later time it doesn't find one, see if that 
location still exists and would still work (in which case the message 
should suggest modifying .libPaths).  I think that's too much work.

Even a simple change like

Error: 'ggplot2' depends on package 'Rcpp', but 'Rcpp' was not found


might not be easy (which function knows both names?)  However, if you 
want to suggest a patch to implement this, I would take a look.

Duncan Murdoch