Man pages for KWB-R/kwb.utils
General Utility Functions Developed at KWB

addClassAdd a Class to an Object
addRowWithNameAdd a Row with a Name
addSuffixToColumnsAdd Suffix to Column Names
allAreEqualare all elements in x the same?
allAreIdenticalAre all list elements identical to each other?
almostEqualCompare Numerical Vectors with Tolerance
appendSuffixAppend Suffix to (Selected) Character Values
arglistMerge Argument Lists or Arguments
argsCsvLanguage Abbreviation to "sep" and "dec" argument
arrayToDataFrameConvert Array to Data Frame
asColumnListMatrix to List of Matrix Columns
asNoFactorDataFrameConvert to Data Frame without Factors
asRowListMatrix to List of Matrix Rows
assertFinalSlashMake Sure that Strings End With Slash
assertRowsAndColumnsAssert Row and Column Names of a Matrix
assignAllCall assign for each List Element
assignArgumentDefaultsAssign Argument Default Values in the Global Environment
assignGloballyassignGlobally
assignObjectsAssign Package Functions to the Global Environment
assignPackageObjectsAssign all Package Objects to the Global Environment
atLeastOneRowInAt least one row in data frame
backspaceString of n Backspaces
breakInSequenceFind "Breaks" in a Sequence of Numbers
callWithCall a Function with Given Arguments
callWithDataCall a Function with Argument Combinations from a Data Frame
callWithStringsAsFactorsCall a Function with Option "stringsAsFactors" set...
catAndRunPrint Debug Messages Before and After Running Code
catChangesPrint Differences Between Two Vectors
catChangesIfPrint Differences Between Two Vectors if Condition is Met
catchWarningReturn Warning Message in Attribute
catIfCall cat If Condition Is Met
catLinesPrint Character Vector to the Console
catNewLineIfPrint New Line Character to the Console if Condition is Met
checkForMissingColumnsCheck for Column Existence
clearConsoleClear the R Console
clipMatrixRemove Leading/Trailing Empty Rows/Columns from Matrix
cmdLinePathPath in Quotes for Usage in Command Line
collapsedShortcut to paste(x, collapse = collapse)
colMaximaColumnwise Maxima
colMinimaColumnwise Minima
colNaNumbersColumnwise Number of NA
colStatisticOneFunctionApply Function to All Columns
colStatisticsColumn Statistics
columnDescriptorColumn Descriptor
columnToDateConvert Column in Data Frame To Date
columnwisePercentageColumnwise Percentage
combineAlternatinglyCombine Two Vectors Alternatingly
commaCollapsedPaste With Collapse = ","
commonNamesCommon Names in two Objects with Names Attribute
compareDataFramesCompare two data frames by columns
compareSetsCompare the values in two vectors
containsNulStringCheck for nul String in File
convertCsvFileModify the format of a CSV file
copyAttributesCopy Attributes Between Two Objects
copyDirectoryStructureCopy Directory Structure
copyListElementsCopy List Elements into a List of Lists
countNaInColumnCount NA in one Column of a Data Frame
countOrSumCount or Sum Up Values Within Groups of rows
createAccessorCreate Function to Safely Access Data Frame Columns or List...
createDirAndReturnPathCreate a Directory including required "upward" Folders
createDirectoriesCreate Directories
createDirectoryCreate Directory if it does not exist
createFunctionAssignObjectsCreate Function to Provide Package Objects in Global...
createFunctionExtdataFileCreate Function to Compose Path in Package
createIdAlongCreate Unique Identifiers along Input Vector
createMatrixMatrix with Row and Column Names
createPasswordFileCreate a File Storing a Password in Encrypted Form
createStorageCreate Storage Object to Save/Load .rds or .RData files
csvTextToDataFrameCSV Text to Data Frame
decodeDecode a Vector of Character
defaultIfReturn a Default Value for Values Meeting a Condition
defaultIfNADefault Value if Object is NA
defaultIfNULLDefault Value if Object is NULL
defaultIfZeroDefault Value if Object is 0 (zero)
defaultLevelsDefault Factor Levels
defaultWindowsProgramFoldersDefault Windows Program Folders
desktopPath to Your Desktop
diffrowsDifferences between Matrix Rows
DIN.A4Width and Height of a DIN A4 Paper
directoryNameSafe Version of Base Function dirname()
dot-logWrite Log Message to Console
dot-loglineWrite Log Message and New Line Character to Console
dot-logokWrite "ok" and New Line Character to Console
dot-logstartWrite Log Message to Console if in Debugging Mode
dot-OStypesee tools:::.OStype
dropDimDrop Array Dimension(s) of Length One
dropUnusedFactorLevelsDrop Unused Factor Levels in all Factor Columns
encodeEncode a Vector of Character
enlargeVectorEnlarge a Vector to Given Length
excludeNULLExclude all NULL Entries from a List
expandGridWrapper around expand.grid
extdataFilePath to File in Installed Package
extendLimitsExtend the Limits of a Range Vector
extractRowRangesExtract Row Ranges by Pattern
extractSubstringExtract Substrings Defined by Regular Expressions
fileExtensionGet Extension of Full File Paths
findChangesFind Value Changes in a Vector
findPartialDuplicatesFind Paritally Duplicated Rows in a Data Frame
finishAndShowPdfClose Device and Open PDF File in Viewer
finishAndShowPdfIfFinish and Display PDF File if Condition is Met
firstElementFirst Element
firstPosixColumndata/time column of data frame
frenchToAsciiFrench Unicode Letter to ASCII Letter(s)
frequencyTableNumber of value occurrences in columns
fullWinPathWindows-Compatible Expanded File Path
fullySortedSort a Data Frame by all of its Columns
generateKeyFileGenerate a Decryption Key File
getAttributeSafely get the Attribute of an Object
getByPositiveOrNegativeIndexGet Vector Elements by Positive or Negative Index
getElementLengthsGet the Lenghts of List Elements
getEvenNumbersGet even Numbers out of a Vector of Integers
getFunctionValueOrDefaultFunction Value or Default if NA
getGloballygetGlobally
get_homedirGet File Path of User's Home Directory
getKeywordPositionsLocalise Keywords in Data Frame
getListNodeGet List Element in Nested List Structure by Path
getNamesOfObjectsInRDataFilesDeprecated. Use 'listObjects' instead.
getObjectFromRDataFileDeprecated. Please use 'loadObject' instead.
getOddNumbersGet odd Numbers out of a Vector of Integers
getPasswordGet Encrypted Password from File Using Key
getPathsAndValuesFromRecursiveListGet Paths and String Values from Recursive List
getTagNamesFind <tag>-tags in string
guessSeparatorGuess Column Separator Used in File
guessSeparator.1Guess Column Separator (Version 1)
guessSeparator.2Guess Column Separator (Version 2)
hasFinalSlashDoes a String End with Slash?
hasZeroLengthDoes an Object Have a Length of Zero?
headtailPrint First and Last Rows of a Data Frame
hsAddMissingColsAdd missing Columns to a Data Frame
hsChrToNumCharacter to Numeric
hsCountInStrCount Pattern in String
hsDelEmptyColsDelete empty Columns of Data Frame
hsMatrixToListFormConvert "Matrix Form" (wide format) to "List Form" (long...
hsMovingMeanMoving Mean
hsOpenWindowsExplorerOpen Windows Explorer
hsPrepPdfPrepare Writing of PDF File
hsQuoteChrQuote Character Strings
hsRenameColumnsRename Columns in a Data Frame (deprecated)
hsResolveResolve Placeholders in Dictionary
hsRestoreAttributesRestore Object Attributes
hsSafeNameNon-existing desired name
hsShellWrapper around "shell"
hsShowPdfOpen PDF file in PDF viewer
hsStringToDateConvert String to Date
hsStringToDoubleConvert String to Double
hsSubstSpecCharsDeprecated. Use 'substSpecialChars' instead.
hsSystemWrapper around "system"
hsTrimRemove Leading and Trailing Spaces
hsValidValueValue in Correct English/German Notation?
indentIndentat a String (Add Spaces to the Left)
inRangecheck for values within minimum and maximum value
insertColumnsInsert new Column(s) into a Data Frame
intToNumeralSystemConvert Integers to Numeral System
isASCIIDo Strings Consist only of ASCII Characters?
isDotOrDoubleDotDoes a string end with one or two dots (".", "..")?
isEvenNumberCheck for Even Numbers
isLoadedHas a Script Been Loaded (with source)?
isNaInAllColumnsisNaInAllColumns
isNaInAllRowsisNaInAllRows
isNaOrEmptyNA or the empty string ""?
isNetworkPathDoes the Path Represent a Network Path?
isNullOrEmptyisNullOrEmpty
isOddNumberCheck for Odd Numbers
isTryErrorDoes an Object Inherit from "try-error"?
is.unnamedAre List Elements Unnamed?
lastElementLast Element
leftLeft Part of a String
leftSubstringEqualsIs Left Substring of X Equal To Y?
limitToRangeLimit Values to Interval
linearCombinationLinear Combination of a Matrix
listObjectsGet Names of Objects in .RData files
listToDepthList Elements Recursively up to Depth
loadFunctionsLoad Functions from Scripts into Attached Namespace
loadObjectLoad R object from .RData file
mainClassMain Class of an Object
makeUniqueMake Duplicated Character Strings Unique adds ".1", ".2",...
matchesCriteriaDo Data Frame Row Match Given Criteria?
matrixToDataFrameConvert a Matrix to a Data Frame (in "Long" Format)
maxStringLengthMaximum String Length in Vector of Character
mergeAllMerge Multiple Data Frames
mergeListsMerge Lists Overriding Elements of the Same Name
mergeNamedArraysMerge List of Named Arrays
moveColumnsToFrontMove Columns to the Left
moveToFrontMove elements to the start of a vector
movingSummovingSum
msgAvailableFieldsMessage Listing Available Fields
multiColumnLookupLookup by Matching Values in Multiple Columns
multiSubstituteMultiple Substitutions
mySystemTimeElapsed Time of a Function Call
nameByElementName List Elements by Sublist Element
namedVectorFromColumnsCreate Named Vector from two Columns of a Data Frame
namedVectorToDataFrameConvert a Named Vector to a Data Frame
naToLastNonNaReplace NA With "Last" non-NA
nNANumber of NA values
noFactorDataFrameCreate Data Frame without Factors
noSuchElementsMessage on Missing Elements
nUniqueNumber of Unique Values
objectSizeObject Size and Sizes of Sub Structures in Mb
objectToTextConvert R Object to Text Representation
orderByOrder a Data Frame by One or more Columns
orderDecreasinglyByOrder Data Frame Decreasingly by one Column
pairwiseReorder Strings So That Matching Strings are Neighbours
parallelNonNAMerge two Vectors selecting non-NA Values
pasteColumnsPaste Columns of Data Frame With Separator
pasteColumns0Paste Columns of Data Frame Without Separator
percentagePercentage
percentageOfMaximumPercentage of Maximum
percentageOfSumPercentage of the Sum of Values
posixColumnAtPositionIndices of POSIX columns in a Data Frame
preparePdfOpen PDF Device with DIN A4 Dimensions by Default
preparePdfIfPrepare PDF File if Condition is Met
printable_charsDifferent Sets of Printable ASCII Characters
printIfCall Print If Condition Is Met
print.repro_samplePrint Method for Object of Class "repro_sample"
quotientQuotient
randomMatrixCreate a Matrix with Random Integer Values
randomValuesWithSumVector of random Integer Values of given Sum
rangeToSequenceCreate Sequence from Range
rbindAllrbind all data frames given in a list
readArglistsRead Argument Lists from CSV File
readCsvInputFileRead CSV File Giving Column Descriptions
readDictionariesRead Dictionary Files into a List of Dictionaries
readDictionaryRead Dictionary from Text File
readLinesWithEncodingRead Lines by Giving the File Encoding
readPackageFileRead File from Package's extdata Folder
recursiveNamesnames of all sublists of a list
recycle"Recycle" Vector to given Length
relativeCumulatedSumRelative Cumulated Sum
removeAttributesRemove all or selected Attributes of an Object
removeColumnsRemove Columns from a Data Frame
removeDuplicatesRemove Duplicated Values from a Vector
removeElementsRemove Elements from a List
removeEmptyRemove Empty Elements from Vector
removeEmpty2Remove Empty Elements from Vector of Character
removeEmptyColumnsRemove empty Columns from a Data Frame
removeExtensionRemove File Name Extension
removeLeadingSlashesRemove Leading Slashes of Strings
removeSpacesRemove all Spaces in String(s)
renameAndSelectRename and Select Columns of a Data Frame
renameColumnsRename Columns in a Data Frame
repeatedRepeated Substring
replaceFileExtensionReplace File Name Extension
reproducibleSampleReproducible Call to the Sample Function
resetRowNamesReset row names to 1:n
resolveResolve String(s) Using a Dictionary
resolveAllResolve all Placeholders in a Dictionary
revertListAssignmentsRevert List Assignments
rightRight Part of a String
roundColumnsRound Columns to given Number of Digits
rowOrColumnwisePercentageRowwise or Columnwise Percentage
rowwisePercentageRowwise Percentage
rStylePathR compatible file path
runBatchfileInDirectoryRun a Batch File in a given Directory
runInDirectoryChange Working Directory and Run Function
safeColumnBind"Safe" version of cbind.
safeMergeMerge By Checking Column Existence
safePathStop if Path does not Exist
safeRowBind"safe" rbind
safeRowBindAll"safe" rbind of all data frames in a list
safeRowBindOfListElementsrow-bind data frames in a list of lists
selectColumnsSelect Columns from a Data Frame
selectElementsSelect (and Rename) Elements from List
setColumnsSet the column(s) of a data frame
setLoadedSet the "loaded" Status for a Script
setMatrixColumnsSet Matrix Columns to Values
shortenShorten Strings to a Maximum Length
showPackageObjectsShow Names of Objects/Functions in a Package
sourceScriptsLoad R Scripts with 'source'
spaceSpace String Used for Indentation
splitAlongDimSplit Array Along a Dimension
splitIntoFixSizedBlocksSplit into Blocks of Same Size
splitIntoLinesSplit Text at End of Line Characters Into Lines
startsToEndsHelper Function: Start Indices to End Indices
startsToRangesRow Numbers of Start Rows to From/To Row Ranges
stopFormattedStop Function Exectution With Formatted Message
stopIfNotMatrixStop with a Message if Input is not a Matrix
stringContainsstringContains
stringEndsWithstringEndsWith
stringListString of Comma Separated Quoted Strings
stringStartsWithstringStartsWith
stringToExpressionConvert String to Expression
subExpressionMatchesFind and Extract Regular Expressions from Strings
substSpecialCharsSubstitution of Special Characters
tableLookupLookup Value for Key in Table
tempSubdirectoryCreate and Return Path to Subdirectory in tempdir()
textToObjectConvert Text Representation Back to R Object
toConditionalConvert Function to Function that is Called if Condition is...
toFactorConvert to Factor with unique Values as Levels
toFormulaCreate Formula from Left and Right Term Strings
toInchesConvert Centimeters to Inches
toKeysAndValuesKey Value String to List of Keys and Values
toLookupClassKeys and Values to Lookup Structure
toLookupListKeys and Values to Lookup List
toLookupTableKeys and Values or List to Lookup Table
toNamedListConvert to List with Names Equal to List Elements
toPdfLet Expressions Plot into a PDF File
toPositiveIndicesNegative Indices to Positive Indices
underscoreToPercentReplace underscore with percent sign
uniqueDirnamesUnique Directory Names
unmergeInvert the Merging of two Data Frames
userName of the Current User
warnIfEmptywarnIfEmpty
warningDeprecatedCreate Warning About a Deprecated Function
windowsPathconvert to MS Windows-compatible path
writeDictionaryWrite a Dictionary (List) to a Text File
writeTextWrite Text Lines to a File
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.