, , , ,

We search a number of functions and libraries during any project in R.

When searching on R console using ? (e.g. ?data.frame), or ?? (e.g. ??cluster), or apropos (e.g. > appropos(cluster)) do not return with the answers what you were looking for, what to do then?

I will suggest you to try “findFn()” which is available from the “sos” package on CRAN.

“findFn” can be thought of an alternative to ? or ?? or as an alias to “???”.

The limitation to use it is that because can’t pass in arguments in this function other than the function name that is being searched.

You can install the “sos” package from CRAN using

# install.packages(sos)
# Loading library


# Search for function "cosine"

findFn("cosine", maxPages = 2, sortby = "MaxScore")
## found 537 matches;  retrieving 2 pages, 40 matches.
## 2 
## Downloaded 35 links in 25 packages.

Here we have done the following:

  • The additional arguments passed in the findFn (“maxPages = 2” and “sortby =”MaxScore“) limits the number of results returned, and specifies how the results are ranked, respectively.
  • The “findFn” called above returns a data frame with nine columns and the results as rows–rendered as HTML.
  • Results are then browsed in your computer’s default browser.