Man pages for DesiQuintans/desiderata
Assorted utility functions

add_group_sizeAdd a 'group size' column to a dataframe
align_titlesHorizontally align ggplot2 title and subtitle
anyFalseAlias for 'any(!(...))'
apply_to_filesApply a function to every file in a folder that matches a...
assign_groupsAssign elements in a vector to groups
basic_colour_namesThe names of 197 common colours
boot_ci_meanBootstrapped confidence interval of the mean
build_paletteBuild a palette of colours from a list of hex codes
cat_wrapPrint to console, wrapping the text to a specific line width
clippyCopy a dataframe, vector, or the result of an expression to...
coinflipRandomly return TRUE or FALSE
col2hsvConvert Hex colours to HSV
collapse_dfCollapse a dataframe into a vector
common_stemReturn the stem that is common to a set of strings
concat_numsConcatenate numbers together
consecutive_monthFind the current month number relative to a starting date
consecutive_weekFind the number of weeks between two dates
construct_colsSubset dataframe columns
count_uniqueCount how many times each unique element in a vector is...
cumpctCumulative percentage
cut_intCuts for dividing an integer into 'n' chunks
degreedaysCalculate degree-days
dendroMake a dendrogram
desideratadesiderata - A pack of personal functions
diff_colsGiven two dataframes, which columns are present in one but...
dots_charConvert dots (...) to a character vector or a string
drop_empty_colsDrop 'empty' columns in a dataframe
drop_empty_rowsDrop 'empty' rows in a dataframe
drop_invar_colsDrop invariant columns from a dataframe
encode_signifReplace p-values with significance codes
ensureQuick assertion function for sanity checking your code
find_dimsFind the nearest rectangle that will fit the number of...
foldFriendly printing of a multi-element vector
geomeanGeometric mean of a vector
howmanyCount the number of unique values
if_naReturn a value or expression if something is NA
instant_runoff_votingInstant run-off voting
interleaveInterleave one string with another
IQR_outliersMark outliers using the 1.5 * IQR method
iris_labelledThe classic Iris dataset, with variable labels
is.flankedIs a vector element surrounded by certain values?
is.primeCheck if an integer is a prime number
keep_everyKeep every other element of a vector, flexibly
loadRDSLoad an RDS file and announce when it was created
make_pathBuild a path, creating subfolders if needed
mark_last_peakMark the location of the last maximum value in a vector
mark_longest_runFind and mark the longest run of TRUEs in a boolean vector
match_in_substrMatch strings that have a needle near the start, end, or...
material2014_colblindGoogle Material Design 2014 palette, with colour-blind...
mirror_matrixMirror a matrix horizontally
ModeMode of a vector (numeric/character/factor)
na_in_rowCount/proportion of 'NA's and not-'NA's per dataframe row
na_rmRemove NAs from vectors, lists, matrices, and dataframes
normalize_colwiseNormalise a matrix column-wise between 0 and 1
normalize_wholeNormalise a whole matrix or vector between 0 and 1
notinInverse match
not.naOpposite of 'is.na()'
not.nanOpposite of 'is.nan()'
nz_boty_2019_headThe first 1000 voters from the New Zealand Bird of the Year...
omit_dipsReplace element with NA if it is less than the elements...
overwrite_dfReplace all matching values in a dataframe with something...
pctinPercentage of matching elements between two vectors
percentileQuick percentile overview
plot_arrangeArrange base R plots on a grid
quick_lmFit and plot a two-term linear model quickly
random_integers10,000 random integers between 0 and 100
rcols_as_hexConvert R's built-in named colours to hex codes
report_diffReport pairwise differences between two vectors
rev_sentenceReverse the order of words in a string
rotate_axis_textRotate and align ggplot2 axis tick labels
rotate_facet_textRotate and align ggplot2 facet labels
round_toRound numbers to a fixed number of decimal places
round_to_durationRound a duration of days to other units
round_to_nearestRound numbers to a nearest "pretty" value
rows_with_naOnly keep rows that contain NA
same_colsGiven two dataframes, which columns appear in both of them?
save_a4Save a ggplot as an A4 image
se_meanStandard error of the mean
set_seed_anySeed the random number generator with a character string (or...
ShowPipeline- and knit-friendly 'View()'
show_coloursPreview a list of colours as a grid
shushSuppress all console printing (cat, print, warning, message)
sort_colsSort columns in a dataframe
split_sizeSplit a vector into chunks of size 'n'
str_collCollapse a vector into a string
str_revReverse every element of a vector
theme_desi_baseMy personally-preferred minimal base plot theme
top_tailFirst and last rows of a dataframe
triangle_numnth Triangle Number (like factorial but with addition)
try.seedGenerate random seeds to preview their effects
unique_nKeep the first n unique elements in a vector
uw'Unwrap' strings by ignoring hard-wrapping from the source...
vec_to_regexCollapse vectors into a regex pattern
write_csv_rdsWrite a dataframe to a CSV and RDS
DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.