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
asColumnListMatrix to List of Matrix Columns
asNoFactorDataFrameConvert to Data Frame without Factors
asRowListMatrix to List of Matrix Rows
assertRowsAndColumnsAssert Row and Column Names of a Matrix
assignAllCall assign for each List Element
assignArgumentDefaultsAssign Argument Default Values in the Global Environment
assignPackageObjectsAssign all Package Objects to the Global Environment
atLeastOneRowInAt least one row in data frame
breakInSequenceFind "Breaks" in a Sequence of Numbers
callWithCall a Function with Given Arguments
callWithStringsAsFactorsCall a Function with Option "stringsAsFactors" set...
catAndRunPrint Debug Messages Before and After Running Code
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
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 = ","
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
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
createDirAndReturnPathCreate a Directory including required "upward" Folders
createDirectoryCreate Directory if it does not exist
createMatrixMatrix with Row and Column Names
createPasswordFileCreate Encrypted Password File for Account
csvTextToDataFrameCSV Text to Data Frame
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
dot-defaultIfReturn a Default Value for Values Meeting a Condition
dot-guessSeparator.1Guess Column Separator (Version 1)
dot-guessSeparator.2Guess Column Separator (Version 2)
dot-isNetworkPathDoes the Path Represent a Network Path?
dot-OStypesee tools:::.OStype
dropDimDrop Array Dimension(s) of Length One
dropUnusedFactorLevelsDrop Unused Factor Levels in all Factor Columns
enlargeVectorEnlarge a Vector to Given Length
excludeNULLExclude all NULL Entries from a List
expandGridWrapper around expand.grid
extendLimitsExtend the Limits of a Range Vector
extractRowRangesExtract Row Ranges by Pattern
extractSubstringExtract Substrings Defined by Regular Expressions
fileExtensionGet Extension of Full File Paths
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
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
getEvenNumbersGet even Numbers out of a Vector of Integers
getFunctionNameGet the Name of a Function
getFunctionValueOrDefaultFunction Value or Default if NA
get_homedirGet File Path of User's Home Directory
getKeywordPositionsLocalise Keywords in Data Frame
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
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
hsSubstSpecCharsSubstitution of Special Characters
hsSystemWrapper around "system"
hsTrimRemove Leading and Trailing Spaces
hsValidValueValue in Correct English/German Notation?
inRangecheck for values within minimum and maximum value
insertColumnsInsert new Column(s) into a Data Frame
isEvenNumberCheck for Even Numbers
isLoadedHas a Script Been Loaded (with source)?
isNaOrEmptyNA or the empty string ""?
isOddNumberCheck for Odd Numbers
is.unnamedAre List Elements Unnamed?
lastElementLast Element
limitToRangeLimit Values to Interval
linearCombinationLinear Combination of a Matrix
listObjectsGet Names of Objects in .RData files
loadObjectLoad R object from .RData file
makeUniqueMake Duplicated Character Strings Unique adds ".1", ".2",...
matchesCriteriaDo Data Frame Row Match Given Criteria?
mergeAllMerge Multiple Data Frames
mergeListsMerge Lists Overriding Elements of the Same Name
mergeNamedArraysMerge List of Named Arrays
moveColumnsToFrontMove Columns to the Start of a Data Frame
moveToFrontMove elements to the start of a vector
msgAvailableFieldsMessage Listing Available Fields
multiSubstituteMultiple Substitutions
mySystemTimeElapsed Time of a Function Call
nameByElementName List Elements by Sublist Element
naToLastNonNaReplace NA With "Last" non-NA
noFactorDataFrameCreate Data Frame without Factors
objectSizeObject Size and Sizes of Sub Structures in Mb
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
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
printIfCall Print If Condition Is Met
randomMatrixCreate a Matrix with Random Integer Values
randomValuesWithSumVector of random Integer Values of given Sum
rbindAllrbind all data frames given in a list
readArglistsRead Argument Lists from CSV File
readCsvInputFileRead CSV File
readDictionariesRead Dictionary Files into a List of Dictionaries
readDictionaryRead Dictionary from Text File
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
removeElementsRemove Elements from a List
removeEmptyColumnsRemove empty Columns from a Data Frame
removeExtensionRemove File Name Extension
removeSpacesRemove all Spaces in String(s)
renameAndSelectRename and Select Columns of a Data Frame
renameColumnsRename Columns in a Data Frame
resetRowNamesReset row names to 1:n
resolveResolve String(s) Using a Dictionary
resolveAllResolve all Placeholders in a Dictionary
revertListAssignmentsRevert List Assignments
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
sourceScriptsLoad R Scripts with 'source'
splitAlongDimSplit Array Along a Dimension
splitIntoFixSizedBlocksSplit into blocks of same size
startsToEndsHelper Function: Start Indices to End Indices
startsToRangesRow Numbers of Start Rows to From/To Row Ranges
stopIfNotMatrixStop with a Message if Input is not a Matrix
stringListString of Comma Separated Quoted Strings
stringToExpressionConvert String to Expression
subExpressionMatchesFind and Extract Regular Expressions from Strings
tableLookupLookup Value for Key in Table
tempSubdirectoryCreate and Return Path of Subdirectory in temp()
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
toPositiveIndicesNegative Indices to Positive Indices
underscoreToPercentReplace underscore with percent sign
unmergeInvert the Merging of two Data Frames
userName of the Current User
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 Dec. 11, 2018, 12:23 p.m.