-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
63 lines (46 loc) · 2.41 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# yawp
<!-- badges: start -->
<!-- badges: end -->
A collection of documented, tested, and packaged helper functions.
## Installation
```{r, eval = FALSE}
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:
```{r,eval = FALSE}
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](https://CRAN.R-project.org/package=dplyr) but adds a feature to ignore specific values
- `summary_se()` re-implements `summarySE()` from ["The Cookbook for R"](http://www.cookbook-r.com/Manipulating_data/Summarizing_data/) with tidy eval syntax
- The moving average functionality in `mav()` is available elsewhere, including for example in `slide()` from [slider](https://CRAN.R-project.org/package=slider)
- While `f1()` calculates the F1 score, other available functions such as `f_meas()` from [yardstick](https://CRAN.R-project.org/package=yardstick) may accommodate more generic applications (i.e. applying weights to precision and recall)