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.
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.
search: Give Search Path for R Objects Gives a list of attach ed packages (see library ), and R objects, usually data.
You can use lsf.
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 .
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")
. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With