Learn R Programming

⚠️There's a newer version (2.1-8) of this package.Take me there.

sos

The sos package provides the fastest literature search I know for anything statistical. It queries the RSiteSearch database and sorts the results by package not just help page. The package includes a vignette reprinted from The R Journal.

Installation

You can install the released version of sos from CRAN with:

install.packages("sos")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("sbgraves237/sos")

Example

This is a basic example which shows you how to solve a common problem:

library(sos)
#> Loading required package: brew
#> 
#> Attaching package: 'sos'
#> The following object is masked from 'package:utils':
#> 
#>     ?
(PL <- findFn('Petal.Length'))
#> found 100 matches;  retrieving 5 pages
#> 2 3 4 5 
#> Downloaded 100 links in 63 packages.
#> Warning in file(templateFile, encoding = "utf-8", open = "r"): file("") only
#> supports open = "w+" and open = "w+b": using the former
#> Warning in print.packageSum(packageSum(x, title = titSum, ...)): Brew created a
#> file of size 0
#> Ignoring template.

The print method for an object of class findFn, like PL, opens two tabs in the default browser: The first has links to individual help pages sorted by package. The second is a package summary.

The current version of sos extracts some information only from installed packages. You can install the leading packages in a search as follows:

installPackages(PL)
PL
#> Warning in file(templateFile, encoding = "utf-8", open = "r"): file("") only
#> supports open = "w+" and open = "w+b": using the former
#> Warning in print.packageSum(packageSum(x, title = titSum, ...)): Brew created a
#> file of size 0
#> Ignoring template.

Copy Link

Version

Install

install.packages('sos')

Monthly Downloads

799

Version

2.1-7

License

GPL (>= 2)

Maintainer

Spencer Graves

Last Published

May 26th, 2023

Functions in sos (2.1-7)

summary.findFn

Summary Method for findFn
writeFindFn2xls

Write a findFn object to an Excel file
unionFindFn

Combine findFn Objects
print.packageSum

print a packageSum object
print.findFn

print a findFn object
sortFindFn

Sort a findFn Object
installPackages

install packages with minimum count
grepFn

Match pattern in a column of a matrix or data.frame
PackageSum2

Add Info from Installed Packages to PackageSummary
packageSum

Add Info from Installed Packages to PackageSummary
Extract.findFn

Subset a findFn object
back2ForwardSlash

Replace backslash with forward slash in a character string
hits

matches attribute of a findFn object
PackageSummary

Summarize findFn Results by Package
CRAN

Test if running as CRAN
findFn

Search Help Pages