Learn R Programming

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

gtools R package

The gtools R package provides functions to assist in R programming, including:

  • assist in developing, updating, and maintaining R and R packages (ask, checkRVersion, getDependencies, keywords, scat),
  • calculate the logit and inverse logit transformations (logit, inv.logit),
  • test if a value is missing, empty or contains only NA and NULL values (invalid),
  • manipulate R’s .Last function (addLast),
  • define macros (defmacro),
  • detect odd and even integers (odd, even),
  • convert strings containing non-ASCII characters (like single quotes) to plain ASCII (ASCIIfy),
  • perform a binary search (binsearch),
  • sort strings containing both numeric and character components (mixedsort),
  • create a factor variable from the quantiles of a continuous variable (quantcut),
  • enumerate permutations and combinations (combinations, permutation),
  • calculate and convert between fold-change and log-ratio (foldchange, logratio2foldchange, foldchange2logratio),
  • calculate probabilities and generate random numbers from Dirichlet distributions (rdirichlet, ddirichlet),
  • apply a function over adjacent subsets of a vector (running),
  • modify the TCP_NODELAY (de-Nagle) flag for socket objects,
  • efficient rbind of data frames, even if the column names dont match (smartbind`),
  • generate significance stars from p-values (stars.pval),
  • convert characters to/from ASCII codes (asc, chr),
  • convert character vector to ASCII representation (ASCIIfy).
  • apply title capitalization rules to a character vector (capwords)

Installation

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

install.packages("gtools")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("r-gregmisc/gtools")

Copy Link

Version

Install

install.packages('gtools')

Monthly Downloads

165,459

Version

3.9.2

License

GPL-2

Issues

Pull Requests

Stars

Forks

Last Published

June 6th, 2021

Functions in gtools (3.9.2)

gtools

gtools: Various R Programming Tools
quantcut

Create a Factor Variable Using the Quantiles of a Continuous Variable
stat_mode

Most frequently occurring value
lastAdd

Non-destructively construct a .Last function to be executed when R exits.
unByteCode

Convert a byte-code function to an interpreted-code function
keywords

List valid keywords for R man pages
stars.pval

Generate significance stars from p-values
loadedPackages

Provide Name, Version, and Path of Loaded Package Namespaces
logit

Generalized logit and inverse logit function
oddeven

Detect odd/even integers
roman2int

Convert Roman Numerals to Integers
invalid

Test if a value is missing, empty, contains only NA or NULL values, or is a try-error.
permute

Randomly Permute the Elements of a Vector
asc

Convert between characters and ASCII codes
dirichlet

Functions for the Dirichlet Distribution
script_file

Determine the directory or full path to the currently executing script
ask

Display a prompt and collect the user's response
running

Apply a Function Over Adjacent Subsets of a Vector
setTCPNoDelay

Modify the TCP_NODELAY (`de-Nagle') flag for socket objects
defmacro

Define a macro
split_path

Split a File Path into Components
scat

Display debugging text
smartbind

Efficient rbind of data frames, even if the column names don't match
checkRVersion

Check if a newer version of R is available
foldchange

Compute fold-change or convert between log-ratio and fold-change.
combinations

Enumerate the Combinations or Permutations of the Elements of a Vector
getDependencies

Get package dependencies
na.replace

Replace Missing Values
mixedsort

Order or Sort strings with embedded numbers so that the numbers are in the correct order
capwords

Capitalize Words for Titles
badDend

Dataset That Crashes Base:::Plot.Dendogram with 'Node Stack Overflow'
baseOf

Transform an integer to an array of base-n digits
binsearch

Binary Search
assert

Defunct Functions in package gtools
ASCIIfy

Convert Characters to ASCII
gtools-deprecated

Deprecated Functions in the gtools package
ELISA

Data from an ELISA assay