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

181,454

Version

3.9.4

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Ben Bolker

Last Published

November 27th, 2022

Functions in gtools (3.9.4)

ELISA

Data from an ELISA assay
gtools

gtools: Various R Programming Tools
keywords

List valid keywords for R man pages
dirichlet

Functions for the Dirichlet Distribution
defmacro

Define a macro
gtools-deprecated

Deprecated Functions in the gtools package
assert

Defunct Functions in package gtools
roman2int

Convert Roman Numerals to Integers
getDependencies

Get package dependencies
quantcut

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

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

Apply a Function Over Adjacent Subsets of a Vector
invalid

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

Replace Missing Values
mixedsort

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

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

Generalized logit and inverse logit function
lastAdd

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

Display debugging text
unByteCode

Convert a byte-code function to an interpreted-code function
stars.pval

Generate significance stars from p-values
split_path

Split a File Path into Components
oddeven

Detect odd/even integers
stat_mode

Most frequently occurring value
permute

Randomly Permute the Elements of a Vector
smartbind

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

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

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

Convert Characters to ASCII
combinations

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

Display a prompt and collect the user's response
baseOf

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

Capitalize Words for Titles
binsearch

Binary Search
asc

Convert between characters and ASCII codes
badDend

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

Check if a newer version of R is available