All functions

CAGR()

Calculate CAGR

any_x()

Function that returns TRUE/FALSE if value exists in x, but returns NA if x consists entirely of NAs

append_to_list()

Append an item to a list dynamically

apply_row()

Apply a function rowwise, selecting variables with dplyr::select() syntax

as_nps()

Convert numeric variable to NPS variable

as_nps_cat()

Convert numeric variable to NPS categorical variable

as_percent()

Convert as percent (string)

box_it()

Convert ordinal variables into binary variables by "boxing"

calc_pc_loglin()

Calculate percentage impact from coefficients of a log-linear model

calc_weights()

Calculate (simple) weights based on the proportion of another variable.

categorise()

Convert numeric variable into categorical variable

char_to_lab()

Convert character variable to labelled integer variable

chr_to_var()

Convert a string / character variable into a labelled double variable, using a pre-specified set of variable and value label mappings.

clean_strings()

Clean strings so that they can be used as variable names or column names

copy_df()

Copy a data frame to clipboard for pasting in Excel

cor_to_df()

Convert correlation matrix into a tidy data frame

create_named_list()

Create a named list object with two vectors

data_dict()

Create a Data Dictionary from a data frame with Variable and Value Labels.

extract_fa_loads()

Function to create a loadings file from the factanal() output

extract_vallab()

Return value labels as tibble

lab_to_char()

Convert labelled double variable to character variable

labelled_quantile()

Convert a numeric into a quantile categorical variable, labelled by lower and upper bounds of quantiles (string)

likert_convert()

Convert a Likert scale from one scale to another

likert_reverse()

Reverse a Likert scale

look_up()

Replace x values with corresponding values using a key

maxmin()

Max-Min Scaling Function

read_df()

Read in a data frame in the clipboard, copied from Excel

recode_vallab()

Recode value labels based on numeric code

remove_na_only()

Remove all columns which contain only NAs Optimised for magrittr / dplyr pipes

remove_zero_only()

Remove all columns which contain only zeros Optimised for magrittr / dplyr pipes

replace_na_range()

Replace NAs randomly from a selected range with replacement

run_hclust()

A wrapper function to run hierarchical clustering

sav_to_rds()

Serialise a SPSS file to RDS

set_vall()

Set value labels

set_varl()

Set variable labels

split_tt()

Split the data into a simple training and testing set

squish()

Returns a single-length vector if all values in vector are identical.

superspread()

Creates dummy variables from multiple categorical variables. Uses data.table() for speed (enhanced from the previous version) Uses dplyr select() special functions to select categorical variables.

superspread_count()

Convert single-code column(s) into "multiple choice" formats, filling data with sum of counts.

superspread_fill()

Convert single-code column(s) into "multiple choice" formats, filling data from a target column

timed_fn()

Create file name with time stamp

ttest_nps()

Performs a t-test on NPS

varl_tb()

Create tidy data frame with variable and variable labels

wrap_text()

Wrap text based on character threshold