Skip to content
Prev 28533 / 63468 Next

RFC: What should ?foo do?

Duncan Murdoch wrote:
Duncan,

I agree in principle with the points that you raise. I suspect that at 
least in part, it might assist new users with some of the issues that 
were raised in the latest incarnation of the 'we need better 
documentation' thread on r-help.

I am not convinced that ?foo should do this however. help("foo") 
conceptually seems predicated upon the notion that a user is looking for 
a reference/help page for a specific function or descriptor called 
'foo'. The user knows the name of the function or descriptor and should 
not have to wait for a search function to locate it or conceptually 
related terms. If the user has a large number of CRAN packages 
installed, such a search can take a rather long time. That's an issue 
for example with help.search().

That being said and being a firm believer in incrementalism, perhaps the 
first step should be to create a new function, called esearch() [as in 
extended search] or doc.search() [as in documentation search] or even 
search.all(). This new function would facilitate searching all of the 
local objects that you list and perhaps others. It would by default be 
uber-inclusive of all categories of such objects. It would support 
functionality along the lines of help.search() in allowing for the use 
of regex and fuzzy matching via grep()/agrep().

The downside of this approach is that we would add yet another search 
function to the list of those already available, each of which searches 
a focused subset of the potential targets for assistance, whether local 
or online. Thus, it would require some level of understanding of the 
general structure of the myriad of local and online resources of R 
related assistance.

Perhaps ?help could be augmented a bit in elucidating some of these 
issues. The See Also there does not reference apropos() for example and 
it might be worthwhile adding something along the lines of the bullets 
in the "Do your homework before posting" section in the Posting Guide. 
Thus ?help can become something of a "first place to look - local 
centralized help resource" for users to identify the tiered help 
resources that are available and to also provide a framework for how to 
use those resources. One could also have links to the online pages for R 
News, R Books, the R Wiki, the R Graph Gallery, Contributed 
Documentation, Bioconductor and Other Documentation, so that users 
become more aware of help resources beyond the documentation installed 
with R by default.

A longer term plan could be to look to consolidate some of these 
functions into a single help/search function perhaps circa R version 
3.0.0. That would enable some time for thoughtful consideration and 
feedback.

That's my US\$ $\displaystyle e^{i\pi} + \sum_{n=1}^\infty \frac{1}{2^n} 
+ 2(10^{-2})$

:-)

HTH,

Marc