Skip to contents

Functions Returning Logical

allAreEqual()
are all elements in x the same?
allAreIdentical()
Are all list elements identical to each other?
almostEqual()
Compare Numerical Vectors with Tolerance
atLeastOneRowIn()
At least one row in data frame
containsNulString()
Check for nul String in File
hasFinalSlash()
Does a String End with Slash?
hasZeroLength()
Does an Object Have a Length of Zero?
hsValidValue()
Value in Correct English/German Notation?
inRange()
check for values within minimum and maximum value
is.unnamed()
Are List Elements Unnamed?
isASCII()
Do Strings Consist only of ASCII Characters?
isDotOrDoubleDot()
Does a string end with one or two dots (".", "..")?
isEvenNumber()
Check for Even Numbers
isLoaded()
Has a Script Been Loaded (with source)?
isNaInAllColumns()
isNaInAllColumns
isNaInAllRows()
isNaInAllRows
isNaOrEmpty()
NA or the empty string ""?
isNetworkPath()
Does the Path Represent a Network Path?
isNullOrEmpty()
isNullOrEmpty
isOddNumber()
Check for Odd Numbers
isTryError()
Does an Object Inherit from "try-error"?
matchesCriteria()
Do Data Frame Row Match Given Criteria?
appendSuffix()
Append Suffix to (Selected) Character Values
assertFinalSlash()
Make Sure that Strings End With Slash
backspace()
String of n Backspaces
collapsed()
Shortcut to paste(x, collapse = collapse)
commaCollapsed()
Paste With Collapse = ","
createIdAlong()
Create Unique Identifiers along Input Vector
defaultLevels()
Default Factor Levels
extractSubstring()
Extract Substrings Defined by Regular Expressions
frenchToAscii()
French Unicode Letter to ASCII Letter(s)
hsCountInStr()
Count Pattern in String
hsQuoteChr()
Quote Character Strings
hsSafeName()
Non-existing desired name
hsSubstSpecChars()
Deprecated. Use substSpecialChars instead.
hsTrim()
Remove Leading and Trailing Spaces
indent()
Indentat a String (Add Spaces to the Left)
left()
Left Part of a String
leftSubstringEquals()
Is Left Substring of X Equal To Y?
makeUnique()
Make Duplicated Character Strings Unique adds ".1", ".2", etc. to duplicate values
maxStringLength()
Maximum String Length in Vector of Character
moveToFront()
Move elements to the start of a vector
multiSubstitute()
Multiple Substitutions
pairwise()
Reorder Strings So That Matching Strings are Neighbours
removeEmpty()
Remove Empty Elements from Vector
removeEmpty2()
Remove Empty Elements from Vector of Character
removeExtension()
Remove File Name Extension
removeLeadingSlashes()
Remove Leading Slashes of Strings
removeSpaces()
Remove all Spaces in String(s)
repeated()
Repeated Substring
right()
Right Part of a String
shorten()
Shorten Strings to a Maximum Length
space()
Space String Used for Indentation
splitIntoLines()
Split Text at End of Line Characters Into Lines
stringContains()
stringContains
stringEndsWith()
stringEndsWith
stringList()
String of Comma Separated Quoted Strings
stringStartsWith()
stringStartsWith
stringToExpression()
Convert String to Expression
subExpressionMatches()
Find and Extract Regular Expressions from Strings
substSpecialChars()
Substitution of Special Characters
uniqueDirnames()
Unique Directory Names
toPdf()
Let Expressions Plot into a PDF File
preparePdf()
Open PDF Device with DIN A4 Dimensions by Default
preparePdfIf()
Prepare PDF File if Condition is Met
finishAndShowPdf()
Close Device and Open PDF File in Viewer
finishAndShowPdfIf()
Finish and Display PDF File if Condition is Met
hsPrepPdf()
Prepare Writing of PDF File
hsShowPdf()
Open PDF file in PDF viewer
DIN.A4()
Width and Height of a DIN A4 Paper

Input and Output Functions

argsCsv()
Language Abbreviation to "sep" and "dec" argument
catAndRun()
Print Debug Messages Before and After Running Code
catLines()
Print Character Vector to the Console
catNewLineIf()
Print New Line Character to the Console if Condition is Met
clearConsole()
Clear the R Console
columnDescriptor()
Column Descriptor
createStorage()
Create Storage Object to Save/Load .rds or .RData files
extdataFile()
Path to File in Installed Package
guessSeparator()
Guess Column Separator Used in File
guessSeparator.1()
Guess Column Separator (Version 1)
guessSeparator.2()
Guess Column Separator (Version 2)
headtail()
Print First and Last Rows of a Data Frame
loadFunctions()
Load Functions from Scripts into Attached Namespace
print(<repro_sample>)
Print Method for Object of Class "repro_sample"
printable_chars()
Different Sets of Printable ASCII Characters
printIf()
Call Print If Condition Is Met
readArglists()
Read Argument Lists from CSV File
readCsvInputFile()
Read CSV File Giving Column Descriptions
readLinesWithEncoding()
Read Lines by Giving the File Encoding
readPackageFile()
Read File from Package's extdata Folder
setLoaded()
Set the "loaded" Status for a Script
sourceScripts()
Load R Scripts with source
writeText()
Write Text Lines to a File

Mathematical, Statistical, Sample Functions

colMaxima()
Columnwise Maxima
colMinima()
Columnwise Minima
colNaNumbers()
Columnwise Number of NA
colStatisticOneFunction()
Apply Function to All Columns
colStatistics()
Column Statistics
countOrSum()
Count or Sum Up Values Within Groups of rows
countNaInColumn()
Count NA in one Column of a Data Frame
expandGrid()
Wrapper around expand.grid
findPartialDuplicates()
Find Paritally Duplicated Rows in a Data Frame
frequencyTable()
Number of value occurrences in columns
getEvenNumbers()
Get even Numbers out of a Vector of Integers
getOddNumbers()
Get odd Numbers out of a Vector of Integers
hsMovingMean()
Moving Mean
linearCombination()
Linear Combination of a Matrix
movingSum()
movingSum
nNA()
Number of NA values
nUnique()
Number of Unique Values
percentage()
Percentage
percentageOfMaximum()
Percentage of Maximum
percentageOfSum()
Percentage of the Sum of Values
quotient()
Quotient
randomValuesWithSum()
Vector of random Integer Values of given Sum
relativeCumulatedSum()
Relative Cumulated Sum
reproducibleSample()
Reproducible Call to the Sample Function
removeDuplicates()
Remove Duplicated Values from a Vector
rowOrColumnwisePercentage()
Rowwise or Columnwise Percentage

Functions Working on Data Frames

addRowWithName()
Add a Row with a Name
addSuffixToColumns()
Add Suffix to Column Names
asNoFactorDataFrame()
Convert to Data Frame without Factors
columnToDate()
Convert Column in Data Frame To Date
columnwisePercentage()
Columnwise Percentage
dropUnusedFactorLevels()
Drop Unused Factor Levels in all Factor Columns
extractRowRanges()
Extract Row Ranges by Pattern
fullySorted()
Sort a Data Frame by all of its Columns
firstPosixColumn()
data/time column of data frame
getKeywordPositions()
Localise Keywords in Data Frame
hsAddMissingCols()
Add missing Columns to a Data Frame
hsDelEmptyCols()
Delete empty Columns of Data Frame
hsRenameColumns()
Rename Columns in a Data Frame (deprecated)
insertColumns()
Insert new Column(s) into a Data Frame
mergeAll()
Merge Multiple Data Frames
moveColumnsToFront()
Move Columns to the Left
multiColumnLookup()
Lookup by Matching Values in Multiple Columns
noFactorDataFrame()
Create Data Frame without Factors
orderBy()
Order a Data Frame by One or more Columns
orderDecreasinglyBy()
Order Data Frame Decreasingly by one Column
pasteColumns()
Paste Columns of Data Frame With Separator
pasteColumns0()
Paste Columns of Data Frame Without Separator
posixColumnAtPosition()
Indices of POSIX columns in a Data Frame
rbindAll()
rbind all data frames given in a list
removeColumns()
Remove Columns from a Data Frame
removeEmptyColumns()
Remove empty Columns from a Data Frame
renameAndSelect()
Rename and Select Columns of a Data Frame
renameColumns()
Rename Columns in a Data Frame
resetRowNames()
Reset row names to 1:n
roundColumns()
Round Columns to given Number of Digits
rowwisePercentage()
Rowwise Percentage
safeColumnBind()
"Safe" version of cbind.
safeMerge()
Merge By Checking Column Existence
safeRowBind()
"safe" rbind
safeRowBindAll()
"safe" rbind of all data frames in a list
selectColumns()
Select Columns from a Data Frame
setColumns()
Set the column(s) of a data frame
splitIntoFixSizedBlocks()
Split into Blocks of Same Size
tableLookup()
Lookup Value for Key in Table
unmerge()
Invert the Merging of two Data Frames

Functions Working on Lists

copyListElements()
Copy List Elements into a List of Lists
excludeNULL()
Exclude all NULL Entries from a List
getElementLengths()
Get the Lenghts of List Elements
getListNode()
Get List Element in Nested List Structure by Path
getPathsAndValuesFromRecursiveList()
Get Paths and String Values from Recursive List
mergeLists()
Merge Lists Overriding Elements of the Same Name
nameByElement()
Name List Elements by Sublist Element
recursiveNames()
names of all sublists of a list
removeElements()
Remove Elements from a List
revertListAssignments()
Revert List Assignments
safeRowBindOfListElements()
row-bind data frames in a list of lists
selectElements()
Select (and Rename) Elements from List

Array/Matrix Functions

clipMatrix()
Remove Leading/Trailing Empty Rows/Columns from Matrix
createMatrix()
Matrix with Row and Column Names
diffrows()
Differences between Matrix Rows
dropDim()
Drop Array Dimension(s) of Length One
matrixToDataFrame()
Convert a Matrix to a Data Frame (in "Long" Format)
mergeNamedArrays()
Merge List of Named Arrays
randomMatrix()
Create a Matrix with Random Integer Values
setMatrixColumns()
Set Matrix Columns to Values
splitAlongDim()
Split Array Along a Dimension

Vector Functions

breakInSequence()
Find "Breaks" in a Sequence of Numbers
combineAlternatingly()
Combine Two Vectors Alternatingly
enlargeVector()
Enlarge a Vector to Given Length
extendLimits()
Extend the Limits of a Range Vector
findChanges()
Find Value Changes in a Vector
firstElement()
First Element
getByPositiveOrNegativeIndex()
Get Vector Elements by Positive or Negative Index
lastElement()
Last Element
limitToRange()
Limit Values to Interval
parallelNonNA()
Merge two Vectors selecting non-NA Values
recycle()
"Recycle" Vector to given Length

General Object Functions

addClass()
Add a Class to an Object
commonNames()
Common Names in two Objects with Names Attribute
copyAttributes()
Copy Attributes Between Two Objects
getAttribute()
Safely get the Attribute of an Object
getNamesOfObjectsInRDataFiles()
Deprecated. Use listObjects instead.
getObjectFromRDataFile()
Deprecated. Please use loadObject instead.
hsRestoreAttributes()
Restore Object Attributes
listObjects()
Get Names of Objects in .RData files
loadObject()
Load R object from .RData file
mainClass()
Main Class of an Object
removeAttributes()
Remove all or selected Attributes of an Object

Conversion Functions

arrayToDataFrame()
Convert Array to Data Frame
asColumnList()
Matrix to List of Matrix Columns
asRowList()
Matrix to List of Matrix Rows
convertCsvFile()
Modify the format of a CSV file
csvTextToDataFrame()
CSV Text to Data Frame
hsChrToNum()
Character to Numeric
hsStringToDate()
Convert String to Date
hsStringToDouble()
Convert String to Double
hsMatrixToListForm()
Convert "Matrix Form" (wide format) to "List Form" (long format)
intToNumeralSystem()
Convert Integers to Numeral System
namedVectorToDataFrame()
Convert a Named Vector to a Data Frame
namedVectorFromColumns()
Create Named Vector from two Columns of a Data Frame
naToLastNonNa()
Replace NA With "Last" non-NA
objectToText()
Convert R Object to Text Representation
rangeToSequence()
Create Sequence from Range
startsToEnds()
Helper Function: Start Indices to End Indices
startsToRanges()
Row Numbers of Start Rows to From/To Row Ranges
textToObject()
Convert Text Representation Back to R Object
toFactor()
Convert to Factor with unique Values as Levels
toFormula()
Create Formula from Left and Right Term Strings
toInches()
Convert Centimeters to Inches
toKeysAndValues()
Key Value String to List of Keys and Values
toLookupClass()
Keys and Values to Lookup Structure
toLookupList()
Keys and Values to Lookup List
toLookupTable()
Keys and Values or List to Lookup Table
toNamedList()
Convert to List with Names Equal to List Elements
toPositiveIndices()
Negative Indices to Positive Indices
underscoreToPercent()
Replace underscore with percent sign

Shortcut Functions to if-statements

catIf()
Call cat If Condition Is Met
defaultIf()
Return a Default Value for Values Meeting a Condition
defaultIfNA()
Default Value if Object is NA
defaultIfNULL()
Default Value if Object is NULL
defaultIfZero()
Default Value if Object is 0 (zero)

Operating System Functions

.OStype()
see tools:::.OStype
cmdLinePath()
Path in Quotes for Usage in Command Line
copyDirectoryStructure()
Copy Directory Structure
createDirAndReturnPath()
Create a Directory including required "upward" Folders
createDirectories()
Create Directories
createDirectory()
Create Directory if it does not exist
defaultWindowsProgramFolders()
Default Windows Program Folders
desktop()
Path to Your Desktop
directoryName()
Safe Version of Base Function dirname()
fileExtension()
Get Extension of Full File Paths
fullWinPath()
Windows-Compatible Expanded File Path
get_homedir()
Get File Path of User's Home Directory
hsOpenWindowsExplorer()
Open Windows Explorer
hsShell()
Wrapper around "shell"
hsSystem()
Wrapper around "system"
mySystemTime()
Elapsed Time of a Function Call
objectSize()
Object Size and Sizes of Sub Structures in Mb
replaceFileExtension()
Replace File Name Extension
rStylePath()
R compatible file path
runBatchfileInDirectory()
Run a Batch File in a given Directory
runInDirectory()
Change Working Directory and Run Function
safePath()
Stop if Path does not Exist
tempSubdirectory()
Create and Return Path to Subdirectory in tempdir()
user()
Name of the Current User
windowsPath()
convert to MS Windows-compatible path

Check Functions

assertRowsAndColumns()
Assert Row and Column Names of a Matrix
catchWarning()
Return Warning Message in Attribute
checkForMissingColumns()
Check for Column Existence
msgAvailableFields()
Message Listing Available Fields
stopIfNotMatrix()
Stop with a Message if Input is not a Matrix
warnIfEmpty()
warnIfEmpty
warningDeprecated()
Create Warning About a Deprecated Function

Debug Functions

.log()
Write Log Message to Console
.logline()
Write Log Message and New Line Character to Console
.logok()
Write "ok" and New Line Character to Console
.logstart()
Write Log Message to Console if in Debugging Mode
assignAll()
Call assign for each List Element
assignArgumentDefaults()
Assign Argument Default Values in the Global Environment
assignGlobally()
assignGlobally
assignObjects()
Assign Package Functions to the Global Environment
assignPackageObjects()
Assign all Package Objects to the Global Environment
getGlobally()
getGlobally
noSuchElements()
Message on Missing Elements
showPackageObjects()
Show Names of Objects/Functions in a Package
stopFormatted()
Stop Function Exectution With Formatted Message

Compare Objects

catChanges()
Print Differences Between Two Vectors
catChangesIf()
Print Differences Between Two Vectors if Condition is Met
compareDataFrames()
Compare two data frames by columns
compareSets()
Compare the values in two vectors

Calling Functions

arglist()
Merge Argument Lists or Arguments
callWith()
Call a Function with Given Arguments
callWithData()
Call a Function with Argument Combinations from a Data Frame
callWithStringsAsFactors()
Call a Function with Option "stringsAsFactors" set temporarily
getFunctionValueOrDefault()
Function Value or Default if NA

Cryptographic Functions

createPasswordFile()
Create a File Storing a Password in Encrypted Form
decode()
Decode a Vector of Character
encode()
Encode a Vector of Character
generateKeyFile()
Generate a Decryption Key File
getPassword()
Get Encrypted Password from File Using Key

Grammar/Dictionary Functions

getTagNames()
Find <tag>-tags in string
hsResolve()
Resolve Placeholders in Dictionary
readDictionaries()
Read Dictionary Files into a List of Dictionaries
readDictionary()
Read Dictionary from Text File
resolve()
Resolve String(s) Using a Dictionary
resolveAll()
Resolve all Placeholders in a Dictionary
writeDictionary()
Write a Dictionary (List) to a Text File

Functions Returning Functions

createAccessor()
Create Function to Safely Access Data Frame Columns or List Elements
createFunctionExtdataFile()
Create Function to Compose Path in Package
createFunctionAssignObjects()
Create Function to Provide Package Objects in Global Environment
toConditional()
Convert Function to Function that is Called if Condition is Met

Non-Categorised Functions

listToDepth()
List Elements Recursively up to Depth