Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find all functions in an R package?

Tags:

r

r-faq

What is the best way to find all the functions associated in a package?? I am currently going through the caTools package. If I do ?caTools or ??caTools I am simply going to get search for functions called that but not the functions in the package. Is there an easy way to access all the functions in the R gui? Are there any good ways to search for functions?

like image 342
jessica Avatar asked Dec 12 '13 04:12

jessica


People also ask

How do I see all functions in a package in R?

We can find the functions inside a package by using lsf. str function but we need to load the package prior to knowing the functions inside.

Which command is used to see all functions in library?

You can use lsf.

How do I see what packages are in R?

You can install the package, either use the RStudio addin menu to scan current file or selected code, or use command line functions. Every external function (fun_inside) and the function that called it (usage) will be listed in table. You can now go to each function, press F1 to find which package it belongs.

Where are R functions stored?

R packages are a collection of R functions, complied code and sample data. They are stored under a directory called "library" in the R environment. By default, R installs a set of packages during installation.


1 Answers

You can get all the objects in your package with:

ls("package:caTools") 

You can get all the function signatures in your package with:

lsf.str("package:caTools") 
like image 148
josliber Avatar answered Oct 08 '22 06:10

josliber