# nflplotR The goal of nflplotR is to provide functions and geoms that help visualization of NFL related analysis. It provides a ggplot2 geom that does the heavy lifting of plotting NFL logos in high quality, with correct aspect ratio and possible transparency. ## Installation The easiest way to get nflplotR is to install it from [CRAN](https://cran.r-project.org/package=nflplotR) with: ``` r install.packages("nflplotR") ``` To get a bug fix or to use a feature from the development version, you can install the development version of nflplotR either from [GitHub](https://github.com/nflverse/nflplotR/) with: ``` r if (!require("pak")) install.packages("pak") pak::pak("nflverse/nflplotR") ``` or prebuilt from the [development repo](https://nflverse.r-universe.dev) with: ``` r install.packages("nflplotR", repos = c("https://nflverse.r-universe.dev", getOption("repos"))) ``` ## Usage Please see the **[Get Started with nflplotR](https://nflplotr.nflverse.com/articles/nflplotR.html)** and **[nflplotR & the gt Package](https://nflplotr.nflverse.com/articles/gt.html)** articles. ## Getting help The best places to get help on this package are: - the [nflverse discord](https://discord.com/invite/5Er2FBnnQa) (for both this package as well as anything R/NFL related) - opening [an issue](https://github.com/nflverse/nflplotR/issues/new/choose) ## Contributing Many hands make light work! Here are some ways you can contribute to this project: - You can [open an issue](https://github.com/nflverse/nflplotR/issues/new/choose) if you’d like to request specific data or report a bug/error. - If you’d like to contribute code, please check out [the contribution guidelines](https://nflplotr.nflverse.com/CONTRIBUTING.html). ## Terms of Use The R code for this package is released as open source under the [MIT License](https://nflplotr.nflverse.com/LICENSE.html). NFL data accessed by this package belong to their respective owners, and are governed by their terms of use. # Package index ## Geoms ggplot2 geoms (geometric objects) that create a `layer()`. A layer combines data, aesthetic mapping, a geom (geometric object), a stat (statistical transformation), and a position adjustment. - [`geom_from_path()`](https://nflplotr.nflverse.com/reference/geom_from_path.md) : ggplot2 Layer for Visualizing Images from URLs or Local Paths - [`geom_median_lines()`](https://nflplotr.nflverse.com/reference/geom_lines.md) [`geom_mean_lines()`](https://nflplotr.nflverse.com/reference/geom_lines.md) : ggplot2 Layer for Horizontal and Vertical Reference Lines - [`geom_nfl_headshots()`](https://nflplotr.nflverse.com/reference/geom_nfl_headshots.md) : ggplot2 Layer for Visualizing NFL Player Headshots - [`geom_nfl_logos()`](https://nflplotr.nflverse.com/reference/geom_nfl_logos.md) : ggplot2 Layer for Visualizing NFL Team Logos - [`geom_nfl_wordmarks()`](https://nflplotr.nflverse.com/reference/geom_nfl_wordmarks.md) : ggplot2 Layer for Visualizing NFL Team Wordmarks ## Theme Elements Themes control the display of all non-data elements of the plot. Theme elements can tweak individual settings inside `theme()`. - [`element_nfl_logo()`](https://nflplotr.nflverse.com/reference/element.md) [`element_nfl_wordmark()`](https://nflplotr.nflverse.com/reference/element.md) [`element_nfl_headshot()`](https://nflplotr.nflverse.com/reference/element.md) : Theme Elements for Image Grobs ## Scales Scales control the details of how data values are translated to visual properties. Override the default scales to tweak details like the axis labels or legend keys, or to use a completely different translation from data to aesthetic. - [`scale_color_nfl()`](https://nflplotr.nflverse.com/reference/scale_nfl.md) [`scale_colour_nfl()`](https://nflplotr.nflverse.com/reference/scale_nfl.md) [`scale_fill_nfl()`](https://nflplotr.nflverse.com/reference/scale_nfl.md) : Scales for NFL Team Colors ## Tables Utility functions that work with the gt package to create html tables. - [`gt_nfl_cols_label()`](https://nflplotr.nflverse.com/reference/gt_nfl_cols_label.md) : Render Logos, Wordmarks, and Headshots in 'gt' Table Column Labels - [`gt_nfl_headshots()`](https://nflplotr.nflverse.com/reference/gt_nfl_headshots.md) : Render Player Headshots in 'gt' Tables - [`gt_nfl_logos()`](https://nflplotr.nflverse.com/reference/gt_nfl_logos.md) [`gt_nfl_wordmarks()`](https://nflplotr.nflverse.com/reference/gt_nfl_logos.md) : Render Logos and Wordmarks in 'gt' Tables - [`gt_pct_bar()`](https://nflplotr.nflverse.com/reference/gt_pct_bar.md) : Format Columns of 'gt' Tables as Percentage Bars - [`gt_render_image()`](https://nflplotr.nflverse.com/reference/gt_render_image.md) : Render 'gt' Table to Temporary png File ## Utilities Various helper functions. - [`ggpreview()`](https://nflplotr.nflverse.com/reference/ggpreview.md) : Preview ggplot in Specified Dimensions - [`nfl_team_factor()`](https://nflplotr.nflverse.com/reference/nfl_team_factor.md) : Create Ordered NFL Team Name Factor - [`nfl_team_tiers()`](https://nflplotr.nflverse.com/reference/nfl_team_tiers.md) : Create NFL Team Tiers - [`valid_team_names()`](https://nflplotr.nflverse.com/reference/valid_team_names.md) : Output Valid NFL Team Abbreviations - [`.nflplotR_clear_cache()`](https://nflplotr.nflverse.com/reference/dot-nflplotR_clear_cache.md) : Clear nflplotR Cache - [`nflverse_sitrep`](https://nflplotr.nflverse.com/reference/nflverse_sitrep.md) : Get a Situation Report on System, nflverse Package Versions and Dependencies # Articles ### All vignettes - [nflplotR & the gt Package](https://nflplotr.nflverse.com/articles/gt.md): How nflplotR works as gt extension - [Get Started with nflplotR](https://nflplotr.nflverse.com/articles/nflplotR.md): A brief introduction to the ggplot2 extension.