Information on package 'kwb.utils' Description: Package: kwb.utils Title: General Utility Functions Developed at KWB Version: 0.8.0.9000 Authors@R: c(person(given = "Hauke", family = "Sonnenberg", role = c("aut", "cre"), email = "hauke.sonnenberg@kompetenz-wasser.de", comment = c(ORCID = "0000-0001-9134-2871")), person(given = "Michael", family = "Rustler", role = "ctb", email = "michael.rustler@kompetenz-wasser.de", comment = c(ORCID = "0000-0003-0647-7726")), person(given = "Kompetenzzentrum Wasser Berlin gGmbH", role = "cph")) Description: This package contains some small helper functions that aim at improving the quality of code developed at Kompetenzzentrum Wasser gGmbH (KWB). License: MIT + file LICENSE URL: https://github.com/kwb-r/kwb.utils BugReports: https://github.com/kwb-r/kwb.utils/issues Suggests: PKI, testthat, covr, knitr, rmarkdown VignetteBuilder: knitr Encoding: UTF-8 RoxygenNote: 7.1.1 RemoteType: github RemoteHost: api.github.com RemoteRepo: kwb.utils RemoteUsername: kwb-r RemoteRef: dev RemoteSha: 611cfa8e76715e175ed33db176b2fcfb320461a4 GithubRepo: kwb.utils GithubUsername: kwb-r GithubRef: dev GithubSHA1: 611cfa8e76715e175ed33db176b2fcfb320461a4 NeedsCompilation: no Packaged: 2021-03-08 00:27:00 UTC; www-data Author: Hauke Sonnenberg [aut, cre] (), Michael Rustler [ctb] (), Kompetenzzentrum Wasser Berlin gGmbH [cph] Maintainer: Hauke Sonnenberg Built: R 4.0.4; ; 2021-03-08 00:27:01 UTC; unix Index: .OStype see tools:::.OStype .defaultIf Return a Default Value for Values Meeting a Condition .guessSeparator.1 Guess Column Separator (Version 1) .guessSeparator.2 Guess Column Separator (Version 2) .isNetworkPath Does the Path Represent a Network Path? .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 DIN.A4 Width and Height of a DIN A4 Paper addClass Add a Class to an Object addRowWithName Add a Row with a Name addSuffixToColumns Add Suffix to Column Names allAreEqual are all elements in x the same? allAreIdentical Are all list elements identical to each other? almostEqual Compare Numerical Vectors with Tolerance appendSuffix Append Suffix to (Selected) Character Values arglist Merge Argument Lists or Arguments asColumnList Matrix to List of Matrix Columns asNoFactorDataFrame Convert to Data Frame without Factors asRowList Matrix to List of Matrix Rows assertFinalSlash Make Sure that Strings End With Slash assertRowsAndColumns Assert Row and Column Names of a Matrix assignAll Call assign for each List Element assignArgumentDefaults Assign Argument Default Values in the Global Environment assignGlobally assignGlobally assignPackageObjects Assign all Package Objects to the Global Environment atLeastOneRowIn At least one row in data frame backspace String of n Backspaces breakInSequence Find "Breaks" in a Sequence of Numbers callWith Call a Function with Given Arguments callWithStringsAsFactors Call a Function with Option "stringsAsFactors" set temporarily catAndRun Print Debug Messages Before and After Running Code catIf Call cat If Condition Is Met catLines Print Character Vector to the Console catNewLineIf Print New Line Character to the Console if Condition is Met checkForMissingColumns Check for Column Existence clearConsole Clear the R Console cmdLinePath Path in Quotes for Usage in Command Line colMaxima Columnwise Maxima colMinima Columnwise Minima colNaNumbers Columnwise Number of NA colStatisticOneFunction Apply Function to All Columns colStatistics Column Statistics collapsed Shortcut to paste(x, collapse = collapse) columnDescriptor Column Descriptor columnToDate Convert Column in Data Frame To Date columnwisePercentage Columnwise Percentage combineAlternatingly Combine Two Vectors Alternatingly commaCollapsed Paste With Collapse = "," compareDataFrames Compare two data frames by columns compareSets Compare the values in two vectors containsNulString Check for nul String in File convertCsvFile Modify the format of a CSV file copyDirectoryStructure Copy Directory Structure copyListElements Copy List Elements into a List of Lists countNaInColumn Count NA in one Column of a Data Frame countOrSum Count or Sum Up Values Within Groups of rows createAccessor Create Function to Safely Access Data Frame Columns or List Elements createDirAndReturnPath Create a Directory including required "upward" Folders createDirectory Create Directory if it does not exist createIdAlong Create Unique Identifiers along Input Vector createMatrix Matrix with Row and Column Names createPasswordFile Create a File Storing a Password in Encrypted Form createStorage Create Storage Object to Save/Load .rds or .RData files csvTextToDataFrame CSV Text to Data Frame decode Decode a Vector of Character defaultIfNA Default Value if Object is NA defaultIfNULL Default Value if Object is NULL defaultIfZero Default Value if Object is 0 (zero) defaultLevels Default Factor Levels defaultWindowsProgramFolders Default Windows Program Folders desktop Path to Your Desktop diffrows Differences between Matrix Rows dropDim Drop Array Dimension(s) of Length One dropUnusedFactorLevels Drop Unused Factor Levels in all Factor Columns encode Encode a Vector of Character enlargeVector Enlarge a Vector to Given Length excludeNULL Exclude all NULL Entries from a List expandGrid Wrapper around expand.grid extendLimits Extend the Limits of a Range Vector extractRowRanges Extract Row Ranges by Pattern extractSubstring Extract Substrings Defined by Regular Expressions fileExtension Get Extension of Full File Paths findPartialDuplicates Find Paritally Duplicated Rows in a Data Frame finishAndShowPdf Close Device and Open PDF File in Viewer finishAndShowPdfIf Finish and Display PDF File if Condition is Met firstElement First Element firstPosixColumn data/time column of data frame frenchToAscii French Unicode Letter to ASCII Letter(s) frequencyTable Number of value occurrences in columns fullySorted Sort a Data Frame by all of its Columns generateKeyFile Generate a Decryption Key File getAttribute Safely get the Attribute of an Object getByPositiveOrNegativeIndex Get Vector Elements by Positive or Negative Index getElementLengths Get the Lenghts of List Elements getEvenNumbers Get even Numbers out of a Vector of Integers getFunctionName Get the Name of a Function getFunctionValueOrDefault Function Value or Default if NA getGlobally getGlobally getKeywordPositions Localise Keywords in Data Frame getNamesOfObjectsInRDataFiles Deprecated. Use 'listObjects' instead. getObjectFromRDataFile Deprecated. Please use 'loadObject' instead. getOddNumbers Get odd Numbers out of a Vector of Integers getPassword Get Encrypted Password from File Using Key getPathsAndValuesFromRecursiveList Get Paths and String Values from Recursive List getTagNames Find -tags in string get_homedir Get File Path of User's Home Directory guessSeparator Guess Column Separator Used in File headtail Print First and Last Rows of a Data Frame hsAddMissingCols Add missing Columns to a Data Frame hsChrToNum Character to Numeric hsCountInStr Count Pattern in String hsDelEmptyCols Delete empty Columns of Data Frame hsMatrixToListForm Convert "Matrix Form" (wide format) to "List Form" (long format) hsMovingMean Moving Mean hsOpenWindowsExplorer Open Windows Explorer hsPrepPdf Prepare Writing of PDF File hsQuoteChr Quote Character Strings hsRenameColumns Rename Columns in a Data Frame (deprecated) hsResolve Resolve Placeholders in Dictionary hsRestoreAttributes Restore Object Attributes hsSafeName Non-existing desired name hsShell Wrapper around "shell" hsShowPdf Open PDF file in PDF viewer hsStringToDate Convert String to Date hsStringToDouble Convert String to Double hsSubstSpecChars Deprecated. Use 'substSpecialChars' instead. hsSystem Wrapper around "system" hsTrim Remove Leading and Trailing Spaces hsValidValue Value in Correct English/German Notation? inRange check for values within minimum and maximum value insertColumns Insert new Column(s) into a Data Frame intToNumeralSystem Convert Integers to Numeral System 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 ""? isNullOrEmpty isNullOrEmpty isOddNumber Check for Odd Numbers lastElement Last Element left Left Part of a String limitToRange Limit Values to Interval linearCombination Linear Combination of a Matrix listObjects Get Names of Objects in .RData files listToDepth List Elements Recursively up to Depth loadObject Load R object from .RData file makeUnique Make Duplicated Character Strings Unique adds ".1", ".2", etc. to duplicate values matchesCriteria Do Data Frame Row Match Given Criteria? matrixToDataFrame Convert a Matrix to a Data Frame (in "Long" Format) mergeAll Merge Multiple Data Frames mergeLists Merge Lists Overriding Elements of the Same Name mergeNamedArrays Merge List of Named Arrays moveColumnsToFront Move Columns to the Start of a Data Frame moveToFront Move elements to the start of a vector movingSum movingSum msgAvailableFields Message Listing Available Fields multiColumnLookup Lookup by Matching Values in Multiple Columns multiSubstitute Multiple Substitutions mySystemTime Elapsed Time of a Function Call naToLastNonNa Replace NA With "Last" non-NA nameByElement Name List Elements by Sublist Element noFactorDataFrame Create Data Frame without Factors objectSize Object Size and Sizes of Sub Structures in Mb objectToText Convert R Object to Text Representation orderBy Order a Data Frame by One or more Columns pairwise Reorder Strings So That Matching Strings are Neighbours parallelNonNA Merge two Vectors selecting non-NA Values pasteColumns Paste Columns of Data Frame With Separator pasteColumns0 Paste Columns of Data Frame Without Separator percentage Percentage percentageOfMaximum Percentage of Maximum percentageOfSum Percentage of the Sum of Values posixColumnAtPosition Indices of POSIX columns in a Data Frame preparePdf Open PDF Device with DIN A4 Dimensions by Default preparePdfIf Prepare PDF File if Condition is Met print.repro_sample Print Method for Object of Class "repro_sample" printIf Call Print If Condition Is Met printable_chars Different Sets of Printable ASCII Characters quotient Quotient rStylePath R compatible file path randomMatrix Create a Matrix with Random Integer Values randomValuesWithSum Vector of random Integer Values of given Sum rbindAll rbind all data frames given in a list readArglists Read Argument Lists from CSV File readCsvInputFile Read CSV File readDictionaries Read Dictionary Files into a List of Dictionaries readDictionary Read Dictionary from Text File readLinesWithEncoding Read Lines by Giving the File Encoding readPackageFile Read File from Package's extdata Folder recursiveNames names of all sublists of a list recycle "Recycle" Vector to given Length relativeCumulatedSum Relative Cumulated Sum removeAttributes Remove all or selected Attributes of an Object removeColumns Remove Columns from a Data Frame removeDuplicates Remove Duplicated Values from a Vector removeElements Remove Elements from a List removeEmptyColumns Remove empty Columns from a Data Frame removeExtension Remove File Name Extension removeSpaces Remove all Spaces in String(s) renameAndSelect Rename and Select Columns of a Data Frame renameColumns Rename Columns in a Data Frame repeated Repeated Substring reproducibleSample Reproducible Call to the Sample Function resetRowNames Reset row names to 1:n resolve Resolve String(s) Using a Dictionary resolveAll Resolve all Placeholders in a Dictionary revertListAssignments Revert List Assignments right Right Part of a String roundColumns Round Columns to given Number of Digits rowOrColumnwisePercentage Rowwise or Columnwise Percentage rowwisePercentage Rowwise Percentage runBatchfileInDirectory Run a Batch File in a given Directory runInDirectory Change Working Directory and Run Function safeColumnBind "Safe" version of cbind. safeMerge Merge By Checking Column Existence safePath Stop if Path does not Exist safeRowBind "safe" rbind safeRowBindAll "safe" rbind of all data frames in a list safeRowBindOfListElements row-bind data frames in a list of lists selectColumns Select Columns from a Data Frame selectElements Select (and Rename) Elements from List setColumns Set the column(s) of a data frame setLoaded Set the "loaded" Status for a Script setMatrixColumns Set Matrix Columns to Values shorten Shorten Strings to a Maximum Length sourceScripts Load R Scripts with 'source' space Space String Used for Indentation splitAlongDim Split Array Along a Dimension splitIntoFixSizedBlocks Split into Blocks of Same Size startsToEnds Helper Function: Start Indices to End Indices startsToRanges Row Numbers of Start Rows to From/To Row Ranges stopIfNotMatrix Stop with a Message if Input is not a Matrix 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 tableLookup Lookup Value for Key in Table tempSubdirectory Create and Return Path of Subdirectory in temp() 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 toPdf Let Expressions Plot into a PDF File toPositiveIndices Negative Indices to Positive Indices underscoreToPercent Replace underscore with percent sign unmerge Invert the Merging of two Data Frames user Name of the Current User warnIfEmpty warnIfEmpty warningDeprecated Create Warning About a Deprecated Function windowsPath convert to MS Windows-compatible path writeDictionary Write a Dictionary (List) to a Text File writeText Write Text Lines to a File Further information is available in the following vignettes in directory '/usr/local/lib/opencpu/apps/ocpu_github_kwb-r_kwb.utils/kwb.utils/doc': functions_array: Array/Matrix Functions (source, pdf) functions_call: Calling Functions (source, pdf) functions_check: Check Functions (source, pdf) functions_conversion: Conversion Functions (source, pdf) functions_crypto: Cryptographic Functions (source, pdf) functions_data_frame: Functions Working on Data Frames (source, pdf) functions_debug: Debug Functions (source, pdf) functions_dictionary: Grammar/Dictionary Functions (source, pdf) functions_if: Shortcut Functions to If-Statements (source, pdf) functions_in_out: Input and Output Functions (source, pdf) functions_list: Functions Working on Lists (source, pdf) functions_logical: Functions Returning Logical (source, pdf) functions_object: General Object Functions (source, pdf) functions_stats: Mathematical or Statistical Functions (source, pdf) functions_string: String Functions (source, pdf) functions_system: Operating System Functions (source, pdf) functions_ungrouped: Non-Categorised Functions (source, pdf) functions_vector: Vector Functions (source, pdf) overview: Overview (source, pdf)