Skip to content

conditional dependencies & loading

2 messages · Kynn Jones, Duncan Murdoch

#
Kynn Jones wrote:
I don't think you can do that.  You can say it suggests both, but it 
will not automatically fail to install if they are not found.  You need 
to put a check into your .onLoad function to fail with an error if 
neither is found.
You would use something like

if (!require(RJSONIO) && !require(rjson)) stop("Need one of RJSONIO or 
rjson")

in your .onLoad function.

Duncan Murdoch