Le-Huynh Truc-Ly's R Code and Templates

Miscellaneous R functions (for graphics, data import, data transformation, and general utilities) and templates (for exploratory analysis, Bayesian modeling, and crafting scientific manuscripts).


lehuynh

R-CMD-check Lifecycle:stable DOI

Le-Huynh Truc-Ly’s R Code and Templates

lehuynh is an R package comprising a collection of miscellaneous R functions and templates that I find particularly useful.

This package includes:

  • Functions for graphics, data importation, data transformation, and general utilities.
  • Templates for Exploratory Analysis, Bayesian modeling, and crafting scientific manuscripts.

Installation

lehuynh R package can be installed from GitHub with:

if(!requireNamespace("devtools", quietly = TRUE)) {
 install.packages("devtools")
}
devtools::install_github("le-huynh/lehuynh")

This package is also accessible for download via Zenodo with the DOI 10.5281/zenodo.10421410.

Functions

  • ggsave_elsevier( ): Save a plot using ggplot2::ggsave( ). Plot size follows instructions of Elsevier journals.
  • import_data( ): Imports multiple data files of the same format from a specified directory. The output is a named list of imported objects.
  • import_excel( ): Imports an Excel file with multiple sheets and returns a named list of imported sheets.
  • lehuynh_theme( ): Personal ggplot2 theme (white background, black axis, black text, etc.).
  • MinMaxScaling( ): Min-max normalization (min = 0, max = 1).
  • new_project( ): Create a project for reproducible purpose.
  • ppc_brms( ): Plot fitted versus observed values for brmsfit Objects.
  • tidytuesday( ): Create a new folder for #tidytuesday challenge.
  • tsi( ): Calculate TSI (Trophic state index) (Carlson, 1977).

Templates

  • draft_elsevier: Creating an Rmarkdown manuscript for Elsevier journals (example).
  • lehuynh_Bayes_brms: Basic steps to fit, check, and interpret a Bayesian model via brms package.
  • lehuynh_EA: Basic steps to do Exploratory Analysis.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("lehuynh")

0.1.1 by Truc-Ly Le-Huynh, 2 years ago


https://github.com/le-huynh/lehuynh, https://le-huynh.github.io/lehuynh/


Report a bug at https://github.com/le-huynh/lehuynh/issues


Browse source code at https://github.com/cran/lehuynh


Authors: Truc-Ly Le-Huynh [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports brms, stats, ggplot2, usethis, ggpubr, purrr, stringr, magrittr, readxl, dplyr, fs, rio, tibble

Suggests testthat, writexl


See at CRAN