Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching for functions in R library

Tags:

search

r

New to the forum. Is there a way to search for functions within a particular library in R?

Lets say I would like a list of all the functions in the "graphics" library. How would do that?

If I want to find the specific documentation on the "plot" command I am having trouble finding the documentation when I used the help.search("plot"). It gives me all these other functions from different libraries. I just want to be able to find and narrow down the searches when I look for a particular function.

like image 471
alphabeta Avatar asked Oct 05 '12 02:10

alphabeta


People also ask

How do I search for a function in R?

search() function in R Language is used to get the list of all the attached packages in the R search path. Parameters: This function takes no parameters.

What is Search () in Rstudio?

search: Give Search Path for R Objects Gives a list of attach ed packages (see library ), and R objects, usually data.

Which command is used to see all functions in a particular library?

You can use lsf.

Why can't R find my function?

This error usually occurs when a package has not been loaded into R via library . R does not know where to find the specified function. It's a good habit to use the library functions on all of the packages you will be using in the top R chunk in your R Markdown file, which is usually given the chunk name setup .


1 Answers

For a listing of all the functions within a package, and links to their documentations, do:

help(package = "graphics")

That of course assumes that you have installed the package.


For your other question:

If you already know the name of the function you are looking for, do not use help.search("plot") but help("plot"). As the name suggests, help.search does a search through all the docs and returns every hit, very much like a Google search.

Finally, know that you can use:

  • ?plot as a shortcut to help("plot")
  • ??plot as a shortcut to help.search("plot").
like image 88
flodel Avatar answered Oct 26 '22 11:10

flodel