knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
This is an R package with basic functionality for generating output for the inky impression.
You can install the development version with:
remotes::install_github('alexwhan/inkyr')
Here's a simple use of the inky palette for ggplot.
``` {r demo1} library(inkyr) library(ggplot2)
set.seed(123) df <- expand.grid(x = 1:19, y = 1:16) df$hex <- sample(factor(1:7), nrow(df), replace = TRUE)
p <- ggplot(df, aes(x, y)) + geom_tile(aes(fill = hex)) + scale_fill_inky(guide = FALSE) + theme_void() + coord_cartesian(expand = FALSE)
p
And to export for the impression: ``` r inkysave(p, "filename.jpg")
The inky_2d_fig
function lets you can define four colours, and builds gradients between for inky output.
``` {r gradient-demo} p <- inky_2d_fig(inky_colours()[3:6])
p
```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.