How can I find out which packages/libraries belong to the functions of a routine written in R?

Asked

Viewed 66 times

2

I have stopped using several routines because programmers do not tell what packages/libraries the functions that are in these routines use. I know that many of these functions are authored by the programmer and are not found in any repository, but thinking that most of them are in packages distributed in the free repositories (CRAN, R-br, ... ) it is possible to find them. Even so, looking for them is a laborious task which becomes a problem.

To get around this problem I want to know how I can enter one or the packages to which a function belongs?

2 answers

3


You can start by trying to find help for packages installed on your machine, for example ??"nome_da_funcao".

However, this will only work if (i) the package is installed and (ii) the function has help page.

Another solution is to search directly in the documentation, by Rsitesearch:

http://search.r-project.org/

You can use the search directly from the command line as well:

RSiteSearch("nome_da_funcao")

There are auxiliary functions like find and getAnywhere but they are even more limited as they only work if the package is loaded in the.

The ideal is always to ask the commands of library are all specified in the script.

  • 1

    also like to search on github by fixing the language R. Example: https://github.com/search?l=R&q=function&type=Code&utf8=%E2%9C%93

1

Some more alternatives:

  1. It may seem obvious, but simply searching for "R function" in Google is almost always sufficient for package functions that are in the CRAN, saving functions with very simple/repeated names.

  2. The site http://www.inside-r.org/ has documentation of all packages in the CRAN, and is usually where you will stop if you use the above method. But if it doesn’t work, you can search directly on the site.

  3. If the function is related to biology, you can also search on the Bioconductor. It’s also a Google destination, but can be more useful directly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.