How to find the functions inside a package in R?


There are so many packages in R and each of these packages have different objectives, thus, the number of functions in these packages are large enough to solve the problems in analysis. A package might have fifteen functions and the other might have hundred, it totally depends on the necessity. 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.

Example1

library(BSDA)
lsf.str("package:BSDA")
CIsim : function (samples = 100, n = 30, mu = 0, sigma = 1, conf.level = 0.95,
type = "Mean")
Combinations : function (n, k)
EDA : function (x, trim = 0.05)
normarea : function (lower = -Inf, upper = Inf, m, sig)
nsize : function (b, sigma = NULL, p = 0.5, conf.level = 0.95, type = "mu")
ntester : function (actual.data)
SIGN.test : function (x, y = NULL, md = 0, alternative = "two.sided", conf.level = 0.95,
...)
SRS : function (POPvalues, n)
tsum.test : function (mean.x, s.x = NULL, n.x = NULL, mean.y = NULL, s.y = NULL, n.y = NULL,
alternative = "two.sided", mu = 0, var.equal = FALSE, conf.level = 0.95)
z.test : function (x, y = NULL, alternative = "two.sided", mu = 0, sigma.x = NULL,
sigma.y = NULL, conf.level = 0.95)
zsum.test : function (mean.x, sigma.x = NULL, n.x = NULL, mean.y = NULL, sigma.y = NULL,
n.y = NULL, alternative = "two.sided", mu = 0, conf.level = 0.95)

Example2

library(sqldf)
lsf.str("package:sqldf")
read.csv.sql : function (file, sql = "select * from file", header = TRUE, sep = ",", row.names,
eol, skip, filter, nrows, field.types, colClasses, dbname = tempfile(),
drv = "SQLite", ...)
read.csv2.sql : function (file, sql = "select * from file", header = TRUE, sep = ";", row.names,
eol, skip, filter, nrows, field.types, colClasses, dbname = tempfile(),
drv = "SQLite", ...)
sqldf : function (x, stringsAsFactors = FALSE, row.names = FALSE, envir = parent.frame(),
method = getOption("sqldf.method"), file.format = list(), dbname, drv = getOption("sqldf.driver"),
user, password = "", host = "localhost", port, dll = getOption("sqldf.dll"),
connection = getOption("sqldf.connection"), verbose = isTRUE(getOption("sqldf.verbose")))

Example3

library(rvest)
lsf.str("package:rvest")
%>% : function (lhs, rhs)
back : function (x)
follow_link : function (x, i, css, xpath, ...)
google_form : function (x)
guess_encoding : function (x)
html : function (x, ..., encoding = "")
html_attr : function (x, name, default = NA_character_)
html_attrs : function (x)
html_children : function (x)
html_form : function (x)
html_name : function (x)
html_node : function (x, css, xpath)
html_nodes : function (x, css, xpath)
html_session : function (url, ...)
html_table : function (x, header = NA, trim = TRUE, fill = FALSE, dec = ".")
html_tag : function (x)
html_text : function (x, trim = FALSE)
is.session : function (x)
jump_to : function (x, url, ...)
minimal_html : function (title, html = "")
pluck : function (x, i, type)
repair_encoding : function (x, from = NULL)
session_history : function (x)
set_values : function (form, ...)
submit_form : function (session, form, submit = NULL, ...)
xml : function (x, ..., encoding = "")
xml_node : function (x, css, xpath)
xml_nodes : function (x, css, xpath)
xml_tag : function (x)

Updated on: 24-Aug-2020

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements