Learn R Programming

toolbox (version 0.1.1)

List, String, and Meta Programming Utility Functions

Description

Includes functions for mapping named lists to function arguments, random strings, pasting and combining rows together across columns, etc.

Copy Link

Version

Install

install.packages('toolbox')

Monthly Downloads

363

Version

0.1.1

License

GPL (>= 2)

Maintainer

Timothy Conwell

Last Published

September 21st, 2022

Functions in toolbox (0.1.1)

jsonStr

Format data as a JSON object (like this: "x": "120").
quoteText

Add single quotes to strings, useful for converting R strings into SQL formatted strings.
pasteCols

Paste together columns of a list/data frame
namesToString

Pastes the names of a object into a string, optionally quoting the names.
pastePaths

Paste parts of file paths/urls separated with single forward-slashes
castLogical

Convert strings to logical.
castDateString

Format a date string as " from a SQL database to a format compatible with a HTML date input value.
castNumeric

Convert strings to numeric if possible, otherwise remains as is.
combineCols

Combine columns of a list/data frame into a list by row
argumentNamedList

Create a named list of length 1 using a name stored in a variable as the name.
argNames

Get the names of the arguments to a function
consolidateList

Group items of a list by name
do.call2

Filters the argument list to match the arguments in what and then calls do.call.
sampleStr

Generates (pseudo)random strings of the specified char length
doubleQuoteText

Add double quotes to strings.
isNULLorNA

Checks if x is NULL or NA
listExtract

Extract the values from each entry in a list of vectors at a specific index