R: Quick and Essential 'R' Tricks for Better Scripts

# Quick and Essential 'R' Tricks for Better Scripts

## Documentation for package ‘quickcode’ version 1.0.9

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

A B C D E F G H I L M N O P R S T U V Y Z misc

## -- A --

add.header | Addin snippet function to add header comment to a current opened file
add.sect.comment | Addin snippet function to custom section comment
add.snippet.clear | Snippet R function to clear console and set directory
add_key | Add index keys to a vector or data frame or list or matrix
ai.duplicate | Prompt guided duplication and editing of files
archivedPkg | Listing of all CRAN archived R packages
as.boolean | Convert boolean values between formats

## -- B --

bionic_txt | Generate a bionic text

## -- C --

cat_to_num | Convert Categorical Values to Numeric Improvement to seq_along()
cat_to_num2 | Convert Categorical Values to Numeric Improvement to seq_along()
chain_func | Combine specific functions as store as one function
chain_sep | simple function chaining routine
clean | Clear environment, clear console, set work directory and load files
clean_file | Extract all comments or functions from a file
clear | Clear environment, clear console, set work directory and load files
cols.rep | Replicate Columns in a Data Frame
compHist | Compare histograms of two distributions
const | Mathematical constants
create_shape | Create geometric shapes with optional text

## -- D --

data_pop | Remove last n rows or column or specified elements from a data frame like array_pop in PHP
data_pop_filter | Remove elements from a data matching filter
data_push | Add data to another data like array_push in PHP
data_rep | Duplicate a data rows or columns X times
data_shuffle | Shuffle a data frame just like shuffle in PHP
date1to3 | Combine vector to create Date, or split Date into vector
date3to1 | Combine vector to create Date, or split Date into vector
detect_outlier | Detect Outliers in a Numeric Vector
detect_outlier2 | Advanced Outlier Detection in Numeric Data with Optional Grouping
duplicate | Duplicate a file with global text replacement

## -- E --

error.out | Error coalescing operator
extract_comment | Extract all comments or functions from a file
extract_IP | Extract all IP addresses from a string

## -- F --

fAddDate | Append date to filename
find_packages | Fetch R package based on keyword
from_tensor_slices | Create Tensor-Like Slices from a Data Frame or Matrix

## -- G --

geo.cv | Calculate geometric coefficient of variation, mean, or SD and round
geo.mean | Calculate geometric coefficient of variation, mean, or SD and round
geo.sd | Calculate geometric coefficient of variation, mean, or SD and round
getDate | Extract all dates from a string
getDistribution | Check if a data fits the distribution
getGitRepoChange | Fetch GitHub Repository Creation & Last Updated Date
getGitRepoStart | Fetch GitHub Repository Creation & Last Updated Date
getWeekSeq | Convert Dates into Numeric Week Counts
get_func_def | Extract all comments or functions from a file

## -- H --

has.error | Check if a call or expression produces errors
header.rmd | Snippet function to add header to a current Rmd opened file

## -- I --

in.range | If number falls within a range of values and get closest values
inc | Increment vector by value
indexed | Add index keys to a vector or data frame or list or matrix
init | Initialize new variables and objects
insertInText | Shiny app function to insert string to current file in RStudio
iqr_outlier | Detect Outliers in a Numeric Vector
is.cauchy | Check if a data fits the distribution
is.Date | Convert Dates into Numeric Week Counts
is.decreasing | Check is numbers in a vector are decreasing or increasing
is.empty | Not empty
is.gamma | Check if a data fits the distribution
is.image | Is file name extension(s) an image
is.increasing | Check is numbers in a vector are decreasing or increasing
is.leap | Convert Dates into Numeric Week Counts
is.logistic | Check if a data fits the distribution
is.lognormal | Check if a data fits the distribution
is.normal | Check if a data fits the distribution
is.poisson | Check if a data fits the distribution
is.uniform | Check if a data fits the distribution
is.weibull | Check if a data fits the distribution

## -- L --

lastwd | Go back to previous directory
learn_rate_scheduler | Learning Rate Scheduler
libraryAll | Load specific R libraries and clear environment
list_push | Add elements to a list like array_push in PHP
list_shuffle | Shuffle a list object just like shuffle in PHP

## -- M --

make_dosing_df | Create Subject-by-Time Dosing Records (Base R) with Optional Subject-Level Covariates
math.mm | Miscellaneous math computations: Corresponding m-m and quantile for confident intervals
math.qt | Miscellaneous math computations: Corresponding m-m and quantile for confident intervals
minus | Decrease vector by value
mix.color | Mix or Blend two or more colors
mix.cols.btw | Mix or Blend colors between two or more colors
mode.calc | Calculate the Mode of a Numeric or Character Vector
multihead_att | Multi-Head Attention
mutate_filter | Mutate only a subset of dataset intact

## -- N --

na.cumsum | Cumulative Sum with NA Removal
ndecimal | Count the number of decimal places
newSuperVar | Create and use a super variable with unique capabilities
normalize.vector | Normalize a Numeric Vector to the Range [0, 1]
not.data | Not a data
not.Date | Convert Dates into Numeric Week Counts
not.duplicated | Not duplicated elements
not.empty | Not empty
not.environment | Not an environment
not.exists | Not exists
not.image | File name extension(s) is Not an image
not.inherits | Not inherit from any of the classes specified
not.integer | Not an integer
not.logical | Not logical
not.na | Not NA
not.null | Not NULL
not.numeric | Not numeric
not.vector | Not a vector
number | Generate a random number (integer)

## -- O --

or | Nullish coalescing operator

## -- P --

pairDist | Calculate the distance of points from the center of a cluster
percent_match | Function to calculate the percentage of matching between two strings
plus | Increment vector by value

## -- R --

randString | Generate a random string
rcolorconst | R Color Constant
rDecomPkg | Check whether an R package has been decommissioned in CRAN
read.csv.print | Read a CSV and preview first X rows and columns
read.table.print | Read in a table and show first X rows and columns
refresh | Clear environment, clear console, set work directory and load files
remove_comment | Extract all comments or functions from a file
remove_content_in_quotes | Extract all comments or functions from a file
rows.rep | Replicate Rows in a Data Frame

## -- S --

sample_by_column | Re-sample a dataset by column and return number of entry needed
setDisAlpha | Check if a data fits the distribution
setOnce | Set a variable only once
sort_file_type | Sort vector by length or file types of its content
sort_length | Sort vector by length or file types of its content
sound_match | Function to calculate the percentage of matching between two strings
strsplit.bool | Split a string of values and return as boolean vector
strsplit.num | Split a string of numbers and return as numeric vector
sub.range | Calculate the Range Difference of a Numeric Vector
summarize.envobj | Get all the environment objects and their sizes
switch_cols | Switch the index of two columns in a data set
switch_rows | Switch the index of two rows in a data set

## -- T --

track_func | Track Function Usage and Performance
trim.file | Remove Empty Lines from a File

## -- U --

unique_len | Combine unique() and length()
unsetDisAlpha | Check if a data fits the distribution

## -- V --

vector_pop | Remove last n elements or specified elements from a vector like array_pop in PHP
vector_push | Add elements to a vector like array_push in PHP
vector_shuffle | Shuffle a vector just like shuffle in PHP

## -- Y --

yesNoBool | Convert Yes/No to Binary or Logical

## -- Z --

zscore | Calculates Z-Scores of a distribution
zscoreGrowthCurve | Calculates Z-Scores of a distribution
zscore_outlier | Detect Outliers in a Numeric Vector
zscore_outlier2 | Detect Outliers in a Numeric Vector

## -- misc --

%.% | simple function chaining routine
%eo% | Error coalescing operator
%match% | Function to calculate the percentage of matching between two strings
%nin% | Not in vector or array
%or% | Nullish coalescing operator