Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the contents of a library interactively in R

Is there an equivalent of dir function (python) in R?

When I load a library in R like -

library(vrtest)

I want to know all the functions that are in that library.

In Python, dir(vrtest) would be a list of all attributes of vrtest.

I guess in general, I am looking for the best way to get help on R while running it in ESS on linux. I see all these man pages for the packages I have installed, but I am not sure how I can access them.

Thanks

like image 514
signalseeker Avatar asked Nov 27 '09 16:11

signalseeker


People also ask

How do I view library in R?

Start R within your package directory, load the devtools library with library(devtools) and then type check() , just as you had used build() and install() to build and install the package.

How do I load library packages in R?

Alternatively, you can install R packages from the menu. In RStudio go to Tools → Install Packages and in the Install from option select Repository (CRAN) and then specify the packages you want. In classic R IDE go to Packages → Install package(s) , select a mirror and install the package.

What is library command in R?

library(help = somename) computes basic information about the package somename, and returns this in an object of class "packageInfo" . (The structure of this class may change in future versions.) When used with the default value ( NULL ) for lib. loc , the attached packages are searched before the libraries.

How do libraries work in R?

In R, a package is a collection of R functions, data and compiled code. The location where the packages are stored is called the library. If there is a particular functionality that you require, you can download the package from the appropriate site and it will be stored in your library.


1 Answers

help(package = packagename) will list all non-internal functions in a package.

like image 179
hadley Avatar answered Sep 28 '22 13:09

hadley