Skip to contents
as_js()
Preserve a string as JS/HTML (prevent translation of characters)
assign_global()
Assign an object to the global environment
assign_in_ns()
Assign a variable into a namespace
character_codes()
Replace HTML Character codes with their character equivalent
col_type_hash
Index of column type conversions
col_types()
Converts input to a specified type output
color_cycle()
Makes a cyclic color palette of a specified length using the specified transformation each cycle
color_distance()
Compute color distance
color_interpolate()
Interpolate between two colors
color_luminance()
Find the luminance of a particular color, scaled 0-1
color_match()
Match colors by visual distance
color_rgb_table()
Convert vector of colors to named tbl
color_separate()
Separate a vector of colors based on their distance
color_text_by_luminance()
Set text color based on luminance
colors2css()
Convert a list of colors to SCSS/Sass variables or classes
common_names()
Find the common names between two objects
comparison_inverse()
Convert a math comparator to it's inverse
comparison_inverse_key
Math comparison comparator inverse key
comparison_key
Math comparison comparator to plain english key
concat_rows()
Concatenate row values in a poorly scraped table
create_simple_get_function()
Create a function that creates an object and assigns it to a namespace the first time it's called and subsequently retrieves it from the namespace thereafter.
creds_to_renviron()
Write named keypairs to an .Renviron / .Rprofile file
css_col2vec()
Convert a CSS representation of a color to an r,g,b numeric
css_col2vec_()
Vectorized version of css_col2vec
dep_read()
object_read()
Read a dependency from file
dep_write()
Write a dependency to file
dir_fn()
Create a directory path pointing function
dirs
Path functions for commonly used directories
.character_codes
Character code conversion table
.file
All the files that can be navigated to with file
if they exist
.time_factor
Timespans as factor
duration_print()
Translate a duration into the human-legible estimation as a character
evens()
Get even numbers
excel_date()
Convert Excel character date representation to a Date
expr_pipe()
Return a list of expressions all piped together as a single expression
ext()
Extract the file extensions from a filepath
file
Go to a specified file
file_fn()
Return the appropriate function for reading the specified path/extension
file_timestamp()
Make a file path compliant ISO8601 timestamp
filter_to()
Change or apply filters to output type
find_by_class()
Find an object by it's class
fml_list()
Print function formals as a list
fn_name()
Retrieve the function name
folder
Go to a specified folder
formula_make()
Create a formula given predictors and a label (response variable)
fun_docs_table()
Create a table of functions and their uses
gbort()
Custom error message
get_from_ns()
Get an object from a namespace
get_global()
Get an object from the global environment
get_package_fns()
Get the names of all exported functions in a package
ginfo()
Custom info message
gitignore_alphabetize()
Alphabetize the .gitignore file
glue_js()
Create a JS string with glue insertions glue .open = !@
& .close = @#
gmsg()
Custom message Message using format_message & cat_line
`%allin%`
Are all lhs values in rhs?
`%nin%`
Are lhs values absent from set on rhs?
`%|0|%`
Replace a 0 length value
`%|%`
Replace NA values in LHS with RHS
`%|legit|%`
If legit lhs, else rhs
`%|try|%`
Try an expression
`%|zchar|%`
Replace zero-length character strings with right hand side
gwarn()
Custom warning message
if_debug()
Run expressions only when option use_debug = TRUE
ignore_files()
Add lines to .gitignore
increment()
Increment an in-place counter
install_remote()
Install a package
installed_to_description()
Changes installed package version relationships to ==
from the usethis
default of >=
interpolate()
Simple interpolate between two numbers
is_error()
Is object an error
is_filepath()
Is path a file path
is_legit()
Is object legit?
is_package()
Is working directory a package?
is_package_dev()
Is package in development or installed
is_project()
Is Session in a Project?
join_check()
Detect possible duplicates of rows or columns after a join
json_validate()
Is JSON file or text valid?
key_out()
Handle different output type requests for match_df
key_pairs_duplicated()
Find duplicates in key pairs
key_pairs_text()
Make key-pairs from a named character vector
larger()
Which is larger
last_updated()
Gather last updated times for on-disk files
len_unique()
The length of unique values in a vector
list.files2()
List full file paths with the file name as the name
list_rename()
Rename a list
load_obj()
Load an R object from a file
luminance_filter()
Filter colors based on a luminance threshold
magnitude_order()
Compute the order of magnitude
magnitude_triplet()
Compute the order of magnitude triplet ie thousand, million, trillion
make_names()
Make a file path name with underscores
map_class()
Match the classes of one object to that of another object
match_df()
Extract matching rows of a data frame.
match_letters()
Match the first n
letters to supplied arguments
max2()
An alternative to max that preserves names
meeting_timer()
Partition a meeting into evenly distributed sections based on how much time is left between when intros end and the end of the meeting
missing_args()
Get the missing arguments from the function as character
mkpath()
Construct a path
month_factor()
Month as factor/numeric
most()
Are most values TRUE
move_files_to_folder()
Move all files to a folder
names_values_switch()
Switch the names and the values of a vector
need_pkg()
Get a function from a package, abort if package not installed.
needs_update()
Check if files need to be updated
nm_to_id()
Make a randomly formatted name into snakecase id
nonull()
Is value non-null?
not_na()
Is value non-NA?
num2str()
Convert numeric value to a string abbreviation with K, M, B for Thousand, Million & Billion
num2str_vec()
Convert number to string Vectorized version
num_chr_suffi
Abbreviations of numeric magnitude
object_ext()
Provide the appropriate file extension for a given object
object_fn()
Return the appropriate function for writing the supplied object to disk
object_write()
Provide the appropriate file read/write function
odds()
Get odd numbers
opts
Check option value.
package_size()
Return the size of a package, or all packages in a folder
path_strip_shiny()
Strip a file path to everything after resourcepath if shiny is running
path_strip_to()
Strip a file path to everything after resourcepath
pkg_chr_split_comma()
Split a list of packages separated by commas
pkg_ns()
Return the current package namespace
profile_script()
profile_script
read_js()
Read Javascript file
regex_op()
Create a compound regex grouped statement
regex_or()
Create a compound regex grouped OR statement
rgb2hex()
Convert r,g,b,a values as string or numeric to hex
rle_df()
rle_df - create a run-length-encoding data.frame
rle_groups()
Create an RLE Grouping from a logical vector
rle_seq()
Create a sequence from the start to the end for a given value from an rle_df
for indexing
round_to()
Find convenient limits of input vectors
same()
Are the values in each object the same?
season_factor()
Season as factor/numeric
shiny_error_recover()
Toggle recover on error when obtuse shiny errors are encountered
size()
size_()
Digital storage size conversion See object.size
smode()
Statistical mode
sort_by_names()
Sort a vector or list by it's name (or self if no names)
startup()
Load project & user-level .Renviron & .Rprofile
str_comparison()
Convert inequality statements between character, mathematic, symbol and function representations
strip_html()
Remove all HTML tags from a character vector
time_aggregates
Timespans as character
time_difftimes
Timespans as durations
time_elapsed()
Return a logical on an interval
time_factor()
Turn timespans into an ordered factor
timespan()
Create a timespan duration
toggle
Toggle or change an option listed in a local .Rprofile for the session
trace_back_json()
Writes a trace back as a json for error logging Useful for remote error logging on deployed shiny apps, such as via Sentry
true_names()
Return the names of all TRUE items in a logical vector
unify_vec_preserve_order()
Unify two vectors preserving the order of x
unique_with_names()
Unique a vector, preserving the names of the first original entries
unit_conversion
Abbreviations of numeric magnitude for various units
unit_find()
Find the row corresponding to a value in unit_conversion
unit_modify()
Modify unit abbreviations
unit_modify_vec()
Modify unit abbreviation, vectorized version
unit_shorthand()
Easily translate long form unit names to shorthand
unit_string()
`unit_string<-`()
Extract the units from a string
unload_namespaces()
Unload namespaces prior to package install
use_UU_reimports()
Write R/aaa_reimports.R file with all current infix operators
use_reimport()
Add a function to reimports
vlookup()
Simple lookup of values
vlookup_from_ref()
Vlookup replace using a lookup column and reference table
was_updated()
Was a file updated in the last hour?
week_bins_per_year()
Create a tbl with each day of the year, it's week number, and the interval containing that week.
week_factor()
Day of the week as factor/numeric
which_cols()
Translate DT Column names to numeric indices using regex matching
write_dir_fn()
Write dir
helper function that are robust to dev vs deployed package states
write_lines()
Write lines at a specific location in a file
write_opts()
Write all the option checking functions to a file
write_to_rprofile()
Write expressions to the .Rprofile
xpath_sibling_between()
Generate xpath to find sibling nodes between two elements The function produces a compounding xpath with each subsequent argument provided. Thus the final argument specified will be the node that is selected by the resulting xpath with the exception of nested_tag_contains
which helps to identify a nested tag by its contents
zchar()
Is zero-length character?
zchar_remove()
Remove zero length strings (or string with all spaces)