knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of ggpivot is to make tables w ggplot2.
Specify x and y categorical variables; let ggplot2 count number of observations or calculate proportions.
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("EvaMaeRey/ggpivot")
library(tidyverse) library(magrittr)
geom_text_twowaycount_script <- readLines("./R/geom_text_twowaycount.R")
library(ggplot2) ggplot(data = mtcars) + aes(x = cyl, y = gear) + geom_text_twowaycount()
geom_tile_twowaycount_script <- readLines("./R/geom_tile_twowaycount.R")
library(ggplot2) ggplot(data = mtcars) + aes(x = cyl, y = gear) + geom_tile_twowaycount() + geom_text_twowaycount(color = "oldlace")
geom_tile_prop_within_x_script <- readLines("./R/geom_tile_prop_within_x.R")
geom_text_prop_within_x_script <- readLines("./R/geom_text_prop_within_x.R")
library(ggplot2) ggplot(data = mtcars) + aes(x = cyl, y = gear) + geom_tile_prop_within_x(width = .8) + geom_text_prop_within_x(color = "oldlace") + aes(fill = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.