From skyebend at skyeome.net  Tue Feb 24 19:29:15 2015
From: skyebend at skyeome.net (Skye Bender-deMoll)
Date: Tue, 24 Feb 2015 10:29:15 -0800
Subject: [Rd] alternatives to do.call() when namespace is attached but not
	loaded?
Message-ID: <54ECC2FB.1090503@skyeome.net>

Dear R-devel

I have a function in a package that essentially provides a wrapper for a 
group of functions in another Suggested package (it sets appropriate 
defaults for the context, transforms output, etc).  I've implemented 
this by verifying that the package was loaded with

require(sna)

and then

do.call(snaFunName, args = args)


The rDevel check is requesting that I use  requireNamespace(sna) instead 
of directly loading the SNA package. This seems reasonable, except that 
I have yet to figure out a way to use do.call to call the function when 
the namespace is attached but package is not loaded. 
do.call("sna::funName",..) doesn't seem to work.

1) Can do.call() call functions that are only namespace attached? Is 
there better way to accomplish this without do.call()? For example, 
should I use getAnywhere('funName') ('tho this doesn't seem to permit 
restricting search to a specific namespace..)

2) Is this an appropriate of require() instead of requireNamespace() to 
ensure that the Suggested package is loaded and attached? Can I ignore 
the check warning?

best,
  -skye



[Rd] alternatives to do.call() when namespace is attached but not loaded?
Skye Bender-deMoll