A collection of functions I frequently use in my research.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("tsostarics/sostools")Some but not all things this package provides:
save_plotwill save PNG, PDF, and SVG figures to separate directories within a provided root directory. E.g.,save_plot(my_plot, "plot", "Figures", ...)will saveFigures/png/plot.png,Figures/pdf/plot.pdf,Figures/svg/plot.svg. The directories will be created if they do not already exist. Width, height, dpi, etc. can be set withinsave_plot.- Watermarking png files with binary-encoded timestamps
- Handle model refit diagnostics for
{brms}and{mgcv}models - Provide additional helpers for use with interactive
{targets}workflows - Extract normal approximations of posterior parameter distributions
from a
brmsfitobject to use as priors for another model. - Create a data grid with some desired values of variables while marginalizing over the other columns.