This is a package to store useful helper functions for personal use such
as ggplot2 and gt themes, and social media captions.
You can install the development version of mitchhenderson from GitHub with:
# install.packages("devtools")
devtools::install_github("mitchhenderson/mitchhenderson-R-package")The social_caption() function generates a HTML string that, when
rendered, shows LinkedIn, Bluesky, and GitHub usernames and icons.
library(mitchhenderson)
socials <- social_caption(icon_colour = "dodgerblue",
font_colour = "black")
socials
#> <span style='font-family:"Font Awesome 6 Brands";color: dodgerblue'></span> <span style='font-family: "Segoe UI";color: black'>Mitch Henderson</span>
#> <span style='font-family:"Font Awesome 6 Brands";color: dodgerblue'></span> <span style='font-family: "Segoe UI";color: black'>mitchhenderson</span>
#> <span style='font-family:"Font Awesome 6 Brands";color: dodgerblue'></span> <span style='font-family: "Segoe UI";color: black'>mitchhenderson</span>This can be used as a caption on ggplot objects.
The new_post() function will create a new folder and .qmd file in
the posts folder of my website project. The arguments to the function
will pre-fill the YAML. This function was found on Thomas Mock’s
blog
with only a very minor modification to remove the console interactivity.
new_post(
title = "My new post",
description = "My new post is about xyz",
draft = TRUE
)The font_hoist() function registers all variants of a font as their
own family. Useful when you want a particular style of a given font.
This doesn’t persist between sessions so it needs to be called in every
script the font needs to be used in.
font_hoist("Myriad Pro")