Skip to content

vpnagraj/yawp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yawp

A collection of documented, tested, and packaged helper functions.

Installation

devtools::install_github("vpnagraj/yawp", branch = "main", build_vignettes = TRUE)

Note that the install command above will install the package from GitHub and build vignettes. If you would prefer not to build vignettes upon install then set build_vignettes = FALSE, which is the default in devtools::install_github().

Features

  • betwixt(): Find values between lower and upper bounds of a range
  • bound(): Bound a vector
  • f1(): Calculate F1 score
  • first_char(): Extract the first character from a string
  • get_mode(): Find the mode
  • gg_zoom(): Zoom in on a ggplot2 plot (EXPERIMENTAL)
  • mav(): Calculate moving average
  • medf(): Format median
  • more(): Add filler rows to a data frame
  • propf(): Calculate and format proportion
  • read_repo(): Read files directly from a GitHub repository (EXPERIMENTAL)
  • summary_se(): Calculate mean and standard error
  • theme_mathbook(): Custom “math book” ggplot2 theme

Usage

The function documentation includes examples of usage, as do the package vignettes:

browseVignettes(package = "yawp")

Inspiration and Related Work

yawp is a utility package, and the functionality it provides is by no means unique. In fact, some of the functions were directly inspired by other tools. For example:

  • betwixt() builds on the concept originally implemented in the between() function in dplyr but adds a feature to ignore specific values
  • summary_se() re-implements summarySE() from “The Cookbook for R” with tidy eval syntax
  • The moving average functionality in mav() is available elsewhere, including for example in slide() from slider
  • While f1() calculates the F1 score, other available functions such as f_meas() from yardstick may accommodate more generic applications (i.e. applying weights to precision and recall)

About

Home to miscellanea

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages