knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The utilsR package rolls several different commonly utilized functions into one package. There are functions for testing column types, reading and updating configuration files, creating or removing directory structures, and creating logs.
Functions:
test_vec_str
: Tests if the vector is a stringtest_vec_num
: Tests if the vector is numbertest_vec_bool
: Tests if the vector is booleanThese functions can take a vector or dataframe column and reutrn TRUE
or FALSE
.
Functions:
read_yaml
: Reads in a yaml fileread_json
: Reads in a json fileupdate_yaml
: Updates a yaml fileupdate_json
: Updates a json fileThese functions are useful to read in and then export an updated configuration file.
Functions:
create_dirs
: Creates directories in the specified listcreate_files
: Creates files in the specified listremove_files
: Removes files in the specified listremove_dirs
: Removes directories in the specified listThese functions are useful to expedite the file structure creation.
Functions:
open_log
: Opens the log fileclose_log
: Closes the log fileThese functions are used to create log files. The log functions also initiate time, so that it's easy to know how long a script file takes to run and logs the output all in one place.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.