Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the package name in R for a specific function?

Tags:

r

I want to use computeEstimate() function. But since the specific package is not installed in my R, I am getting error:

could not find function "computeEstimate"

Can you please let me know which package I should install to get this function? Also - how do I find a package for a specific function in R?

like image 495
Aloke Maity Avatar asked Sep 04 '15 11:09

Aloke Maity


People also ask

How do I see package functions 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.

How do I specify a function from a package in R?

Every time you start a new R session you'll need to load the packages/libraries that contain functions you want to use, using either library() or require() . If you load a package with the same function name as in another package, you can use packageName::functionName() to call the function directly.

What package is function %>% in R?

The pipe operator, written as %>% , has been a longstanding feature of the magrittr package for R. It takes the output of one function and passes it into another function as an argument.

Where are my R packages located?

View the list of installed packages. Note that, in RStudio, the list of installed packages are available in the lower right window under Packages tab (see the image below).


1 Answers

Install the package sos first, then:

require("sos")
findFn("computeEstimate")

This function searches the help pages of packages covered by the RSiteSearch archives (which includes all packages on CRAN).

Although for your example, it did not find a package.

But for example

findFn('multiply',maxPages = 1)

works fine. Are you sure the function exists somewhere?

like image 89
Wannes Rosiers Avatar answered Oct 24 '22 01:10

Wannes Rosiers