# wjake This is a personal R package containing utility functions and custom themes for [ggplot2](https://ggplot2.tidyverse.org/) and [gt](https://gt.rstudio.com/). ## Installation You can install the released version of wjake from [CRAN](https://cran.r-project.org/) with: ``` r install.packages("wjake") ``` To install the development version from [GitHub](https://github.com/) use: ``` r # install.packages("remotes") remotes::install_github("wjakethompson/wjake") ``` ## Examples Create branded plots with [`theme_wjake()`](https://wjake.wjakethompson.com/reference/theme_wjake.md): ``` r library(ggplot2) ggplot(penguins, aes(x = bill_len, y = flipper_len)) + geom_point(aes(color = species), na.rm = TRUE) + labs( x = "Bill length (mm)", y = "Flipper length (mm)", title = "Seminal ggplot2 scatterplot example", subtitle = "A plot that is only useful for demonstration purposes", caption = "Brought to you by \U1F427", color = "Species" ) + theme_wjake() ``` ![](reference/figures/README-penguin-plot-1.png) And tables with [`gt_theme_wjake()`](https://wjake.wjakethompson.com/reference/gt_theme_wjake.md): ``` r library(gt) head(penguins) |> gt() |> gt_theme_wjake(bg_color = "white") |> fmt_number(year, decimals = 0, use_seps = FALSE) ``` | species | island | bill_len | bill_dep | flipper_len | body_mass | sex | year | |----|----|----|----|----|----|----|----| | Adelie | Torgersen | 39.1 | 18.7 | 181  | 3,750  | male | 2007  | | Adelie | Torgersen | 39.5 | 17.4 | 186  | 3,800  | female | 2007  | | Adelie | Torgersen | 40.3 | 18.0 | 195  | 3,250  | female | 2007  | | Adelie | Torgersen | NA | NA | NA | NA | NA | 2007  | | Adelie | Torgersen | 36.7 | 19.3 | 193  | 3,450  | female | 2007  | | Adelie | Torgersen | 39.3 | 20.6 | 190  | 3,650  | male | 2007  | | Table: @wjakethompson.com | | | | | | | | ## Code of Conduct Please note that the wjake project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. # Package index ## Formatting numbers for text - [`fmt_digits()`](https://wjake.wjakethompson.com/reference/formatting.md) [`fmt_count()`](https://wjake.wjakethompson.com/reference/formatting.md) [`fmt_corr()`](https://wjake.wjakethompson.com/reference/formatting.md) [`fmt_prop()`](https://wjake.wjakethompson.com/reference/formatting.md) [`fmt_pct()`](https://wjake.wjakethompson.com/reference/formatting.md) [`fmt_prop_pct()`](https://wjake.wjakethompson.com/reference/formatting.md) : Text and Number Formatting - [`apa_words()`](https://wjake.wjakethompson.com/reference/apa_words.md) : Write APA Words - [`round_to()`](https://wjake.wjakethompson.com/reference/round_to.md) : Round to a specified value ## ggplot2 helpers - [`theme_wjake()`](https://wjake.wjakethompson.com/reference/theme_wjake.md) : Personalized ggplot2 theme - [`scale_x_comma()`](https://wjake.wjakethompson.com/reference/xy_scales.md) [`scale_y_comma()`](https://wjake.wjakethompson.com/reference/xy_scales.md) [`scale_x_percent()`](https://wjake.wjakethompson.com/reference/xy_scales.md) [`scale_y_percent()`](https://wjake.wjakethompson.com/reference/xy_scales.md) : X & Y scales for percent and comma labels - [`palette_okabeito`](https://wjake.wjakethompson.com/reference/palette_okabeito.md) : Okabe-Ito color palette - [`palette_wjake`](https://wjake.wjakethompson.com/reference/palette_wjake.md) : Personal color palette - [`make_color_pal()`](https://wjake.wjakethompson.com/reference/color_ramp.md) [`ramp_blue()`](https://wjake.wjakethompson.com/reference/color_ramp.md) [`ramp_yellow()`](https://wjake.wjakethompson.com/reference/color_ramp.md) [`ramp_yelblu()`](https://wjake.wjakethompson.com/reference/color_ramp.md) [`ramp_orgblu()`](https://wjake.wjakethompson.com/reference/color_ramp.md) : Custom color ramps ## gt helpers - [`gt_theme_wjake()`](https://wjake.wjakethompson.com/reference/gt_theme_wjake.md) : Personalized gt theme - [`gt_theme_apa()`](https://wjake.wjakethompson.com/reference/gt_theme_apa.md) : Title ## Miscellaneous - [`announce()`](https://wjake.wjakethompson.com/reference/announce.md) : Create an announcement adjective - [`code_heading()`](https://wjake.wjakethompson.com/reference/code_heading.md) : Create heading dividers - [`write_pkg_bib()`](https://wjake.wjakethompson.com/reference/write_pkg_bib.md) : Write a bibliography for R packages