Skip to contents

Data Manipulation

Reshaping, recoding, ordering, and inspecting data structures.

num() int() chr() nchr() bin()
Type Coercion Shortcuts
toBaseR()
Back to Basics with Tibbles
as.array(<xtabs>) as.matrix(<xtabs>)
Coerce xtabs Object to Array or Matrix
asBinary()
Coerce a Vector to Binary (0/1)
combLevels()
Combine Levels from Multiple Inputs
dummy()
Generate Dummy Codes for a Factor
mReplace()
Replace Multiple Values in a Vector
nf()
Convert to Numeric via Factor
recodeX()
Recode a Variable
revCode()
Reverse Coding of Variables
stringsAsFactors()
Convert Character Columns to Factors
collapseTable()
Collapse Table Dimensions by Remapping Factor Levels
toLong() toWide()
Reshape Between Long and Wide Format
splitAt()
Split a Vector at Given Positions
splitX()
Split Data into Groups (Extended Interface)
untable()
Recover Original Data From Contingency Table
binaryTree()
Binary Tree
revX()
Reverse the Order of Elements
sortX()
Sort Vectors, Matrices, Tables, and Data Frames
appendEnum()
Add an Enumeration Column
appendRowNames()
Append Rownames to a Data Frame or Matrix
appendX()
Append Elements to Objects
multMerge()
Merge Multiple Data Frames
`%[]%` `%[)%` `%(]%` `%()%` `%][%` `%](%` `%)[%` `%)(%`
Operators To Check, If a Value Lies Within Or Outside a Given Range
`%:%` `%::%`
Select a Range Between Two Elements
overlap() overlaps() distance() `%overlaps%`
Interval Arithmetic
allDuplicated()
Logical Indicator for All Values Involved in Ties
allIdentical()
Test Whether Multiple Objects Are Identical
compareDataFrames()
Compare Two Data Frames by Key Column
flags()
Extract Dichotomous (Binary) Variables
isDichotomous()
Check Whether a Vector Is Dichotomous
isEuclid()
Test if a Distance Matrix Is Euclidean
isLowCardinality()
Check for Low Cardinality
isNumeric()
Check Whether an Object Is a Valid Numeric Vector
isWholeLike()
Test Whether Values Are (Nearly) Whole Numbers
isZero()
Check a Vector For Being Zero
nUnique()
Count Unique Values
applySides()
Open One Side of a Confidence Interval
checkConfLevel()
Validate a Confidence Level
checkFlag()
Validate a Logical Flag
checkCount()
Validate a Count
checkString()
Validate a Character String
completeColumns()
Identify Columns Without Missing Values
countCompCases()
Count Complete Cases
strX()
Extended str() with numbered variables
columnWrap()
Column Wrap
printCharMatrix()
Pretty-print a character matrix with alignment, spacing and column splitting
resolveContingency()
Resolve a Contingency Table
resolveFormula()
Parse and Classify a Model Formula
resolveGroups()
Resolve Grouped Data

Vectors

Vector-level utilities: NA handling, moving windows, resizing.

coalesceX()
Return the First Element Not Being NA
isNA()
Test for a Scalar Missing Value
locf()
Last Observation Carried Forward
naIf()
Replace Values with NA
naReplace()
Replace NA Values
midx()
Midpoints of a Numeric Vector
moveAvg()
Moving Average
quot()
Lagged Quotients
setLength()
Set the length of a vector, padding or truncating as needed
trim()
Trim a Vector
vRot()
Rotate a vector
vShift()
Shift a vector with NA padding
closest()
Find the Closest Value
nz()
Extract Non-Zero Values
unwhich()
Inverse Which

Numbers & Mathematics

Number theory, base conversion, and numerical utilities.

digitSum()
Digit Sum for Integer Values
divisors()
Calculate Divisors
factorize()
Prime Factorization of Integers
fibonacci()
Fibonacci Numbers
GCD() LCM()
Greatest Common Divisor and Least Common Multiple
isOdd()
Test if Numbers Are Odd
isPrime()
Test Whether Numbers Are Prime
primes()
Generate Prime Numbers up to Given Limits
hexToDec() decToHex() octToDec() decToOct() binToDec() decToBin() romanToInt() baseToBase()
Convert Numbers Between Bases
crossProd()
Cross Product of 3D Vectors or Matrices
crossProdN()
Generalized Cross Product via Determinants
dotProd()
Dot Product of Vectors or Matrices
roundTo()
Round to a Multiple
unirootAll()
Find multiple roots of a function within an interval
nDec() maxDec() prec() frac()
Precision, Decimal Places and Fractional Part of a Numeric Value
linScale()
Linearly Rescale Numeric Data
logit() logitInv()
Logit Transformation and Its Inverse
percentRank()
Percent Rank of a Numeric Vector
rankX()
Fast Ranking with Extended Tie Handling
winsorize()
Winsorize a Numeric Vector
ptInPoly()
Point-in-Polygon Test (Angle Summation, Rcpp)
withSeed()
Evaluate an expression under a temporary random seed

Strings

Character conversion and string transformation.

charToAscii() asciiToChar()
Character <-> ASCII Conversion
mGsub()
Multiple String Substitution
strSplitToCol()
Split Strings into Multiple Columns
strSplitToDummy()
Split a Character Vector into a Dummy Matrix

Combinatorics

Combinations, permutations, and sampling.

combN()
Number of Combinations of a Set
combPairs()
Get All Pairs Out of One or Two Sets of Elements
combSet()
Samples for Combinations of a Set
pairApply()
Pairwise Calculations
permn()
Set of Permutations
randGroupSplit()
Randomly Split a Vector into Groups of Given Sizes
sampleX()
Random Samples and Permutations
rSum21()
Random Numbers Summing to 1
rBetaShape()
Generate Beta-Distributed Random Values by Shape

Files & Paths

File I/O and path/URL handling.

buildPath()
Construct a Normalized File Path
fileExistURL()
Check if a File Exists at a URL
findDownload()
Locate a File in the Downloads Directory
isFilePath()
Check Whether a String Is a File Path
isURL()
Check Whether a String Is a URL
readDownload()
Read a File from the Downloads Directory
splitPath()
Split a File Path into Its Components
parseSASDatalines()
Parse SAS DATALINES/CARDS blocks into a data.frame
pdfManual()
Open CRAN PDF Manual of a Package
peekFile()
Preview a Delimited Text File

Labels & Attributes

Variable labels, object attributes, and metadata import.

setAttr() removeAttr() keepAttr()
Set and Remove Object Attributes
label() `label<-`()
Get or Set Object and Variable Labels
renameX()
Rename Elements of a Named Object
setNamesX()
Set the Names in an Object
dataDescription()
Extract Data Description from Excel File
openDataObject()
Load Excel Data with Metadata (Codes and Labels)

Dates

Date/time formatting.

asCDateFmt()
Convert Custom Date Format to strftime Format

Package Introspection

Inspecting functions, arguments, and Rd documentation.

funArgs()
List All Arguments of a Function
funCalls()
List Calls Used in Function
funKeywords()
List Keywords For R Manual Pages
funList()
List Functions in a Package
rdLabels()
Extract Variable Labels from Rd Documentation
rdTitle()
Extract the Title from an Rd Help File
callIf()
Conditionally Call a Function
extractArgs()
Extract Named Arguments from Dots with Defaults
getDotsArg()
Get a Single Argument from Dots with Default
mergeArgs()
Merge Default Arguments with User Overrides
recycle()
Recycle a List of Elements

Datasets

Example datasets shipped with bedrock.

Cards
Playing Cards dataset
Pizza
Pizza Delivery Data (Extended)
Roulette
European Roulette Wheel
Tarot
Tarot Cards dataset
courseData()
Load Course Dataset from Server