stevec
stevec

Reputation: 52668

List of all functions in base R?

CRAN provides manuals for each CRAN package and the manuals contain a list of every function (and dataset) contained in those CRAN packages.

Is there something similar for base R? i.e. where can be found a list of all the functions in base R?

Upvotes: 5

Views: 1912

Answers (3)

Grant
Grant

Reputation: 1636

CRAN actually provides full documentation for the standard base library too, i.e. in addition to user-contributed CRAN packages: https://search.r-project.org/R/doc/html/packages.html

Here is the base package's help documentation, for example: https://search.r-project.org/R/refmans/base/html/00Index.html

As a general observation, CRAN's refmans pages are simultaneously underrated and more obscure than they should be. We can probably blame the opportunistic SEO of various data science companies for this annoying outcome. Plus the refmans versions are always up to date, unlike some other options. (Looking at you, DataCamp/RDocumentation.)

Upvotes: 1

zhd
zhd

Reputation: 77

As of R 4.2.1 version, the codes below will give you full lists of R base functions.

library(help = "base")

Upvotes: 3

Konrad Rudolph
Konrad Rudolph

Reputation: 545963

As noted by user alistaire in a comment, help(package = 'base') will show an index of the functions in the base package.

However, “base R” is generally understood to encompass more than just the base package, namely the other packages that are also by default loaded by R. This list of packages is accessible via getOption('defaultPackages') (but note that this list is user modifiable, e.g. in ~/.Rprofile!).

As of R 3.6.1, this list is (and has been, for a while)

[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"

If you want to list all exported symbols from these packages, you could use, for instance

base_packages = getOption('defaultPackages')
names(base_packages) = base_packages
lapply(base_packages, function (pkg) ls(paste0('package:', pkg)))

Upvotes: 6

Related Questions